Browse Source

Merge pull request #1744 from svaarala/add-codemetrics-test-job

Add codemetrics test job
pull/1748/head
Sami Vaarala 7 years ago
committed by GitHub
parent
commit
7c9c66cca7
  1. 34
      testrunner/run_commit_test.py
  2. 8
      util/build_benchmarks_page.py
  3. 35
      website/benchmarks.html

34
testrunner/run_commit_test.py

@ -968,6 +968,38 @@ def context_linux_x86_graph_hello_size():
def context_linux_x32_graph_hello_size():
return context_linux_graph_hello_size_helper('-mx32')
def context_codemetrics():
def scandir(path):
count = 0
lines = 0
for fn in os.listdir(path):
count += 1
with open(os.path.join(path, fn), 'rb') as f:
data = f.read()
lines += data.count('\n') # assume trailing newline on last line
return count, lines
if os.path.exists(os.path.join('.', 'src')):
source_files, source_lines = scandir(os.path.join('.', 'src'))
else:
source_files, source_lines = scandir(os.path.join('.', 'src-input'))
ecma_test_files, ecma_test_lines = scandir(os.path.join('.', 'tests/ecmascript'))
api_test_files, api_test_lines = scandir(os.path.join('.', 'tests/api'))
set_output_result({
'source_files': source_files,
'source_lines': source_lines,
'ecma_test_files': ecma_test_files,
'ecma_test_lines': ecma_test_lines,
'api_test_files': api_test_files,
'api_test_lines': api_test_lines
})
# Counts for markers like XXX
# Repo clone size
return True
context_handlers = {
# Linux
@ -1040,6 +1072,8 @@ context_handlers = {
'linux-x64-minisphere': context_linux_x64_minisphere,
'linux-x64-dukluv': context_linux_x64_dukluv,
'codemetrics': context_codemetrics,
# OS X: can currently share Linux handlers
'osx-x64-ecmatest': context_linux_x64_ecmatest,

8
util/build_benchmarks_page.py

@ -56,6 +56,14 @@ def main():
with open('/tmp/tmp-result.json', 'rb') as f:
data = json.loads(f.read())
for commit in data:
for run in commit.get('runs', []):
# Censor some fields which take a lot of space
if run.has_key('output_uri'):
del run['output_uri']
if run.has_key('result') and run['result'].has_key('traceback'):
del run['result']['traceback']
doc = {
'commit_simples': data,
'annotations': annotations

35
website/benchmarks.html

@ -184,6 +184,7 @@ the right. Graphs implemented using
<div class="duk-graph" id="linux-x32-gcc-stripsize-fltoetc"></div>
<div class="duk-graph" id="linux-x64-gcc-defsize-makeduk"></div>
<div class="duk-graph" id="linux-x64-gcc-defsize-fltoetc"></div>
<div class="duk-graph" id="codemetrics"></div>
<script>
[
@ -247,6 +248,40 @@ drawGraph({
}
]
});
drawGraph({
context: 'codemetrics',
domId: 'codemetrics',
graphTitle: 'codemetrics',
xTitle: 'Merge to master',
yTitle: 'Files/lines',
dataCallbacks: [
{
traceName: 'source_lines',
callback: function (result) { return result.source_lines; }
},
{
traceName: 'source_files',
callback: function (result) { return result.source_files; }
},
{
traceName: 'ecma_test_lines',
callback: function (result) { return result.ecma_test_lines; }
},
{
traceName: 'ecma_test_files',
callback: function (result) { return result.ecma_test_files; }
},
{
traceName: 'api_test_lines',
callback: function (result) { return result.api_test_lines; }
},
{
traceName: 'api_test_files',
callback: function (result) { return result.api_test_files; }
}
]
});
</script>
<!--

Loading…
Cancel
Save