Commit b69dbf64 authored by Filip Pokryvka's avatar Filip Pokryvka 🤸🏻
Browse files

run.j-dump: last test time + fix time for skipped tests

parent ddbaf964
......@@ -141,6 +141,7 @@ class Job:
if "runtest.sh 'Running test " in line:
test_name = line.split("runtest.sh 'Running test ")[1][:-1]
when = "bs"
test_time = 0
bs_time = 0
as_time = 0
tags_as_time = 0
......@@ -283,28 +284,35 @@ class Job:
num = len(test_stats["builds"])
if num == 0:
continue
builds_stats = test_stats["builds"].values()
builds_stats = list(test_stats["builds"].items())
builds_stats.sort(key=lambda x: -x[0])
builds_stats = [b[1] for b in builds_stats]
test_stats["num"] = num
test_stats["num_pass"] = len([t for t in builds_stats if t["status"] == "PASS"])
test_stats["num_fail"] = len([t for t in builds_stats if t["status"] == "FAIL"])
test_stats["num_skip"] = len([t for t in builds_stats if t["status"] == "SKIP"])
test_stats["time_avg"] = sum([t["time"] for t in builds_stats])/num
test_stats["time_last"] = builds_stats[0]["time"]
test_stats["time_min"] = min([t["time"] for t in builds_stats])
test_stats["time_max"] = max([t["time"] for t in builds_stats])
test_stats["time_dev"] = math.sqrt(sum([t["time"]**2 for t in builds_stats])/num)
test_stats["bs_avg"] = sum([t["bs"] for t in builds_stats])/num
test_stats["bs_last"] = builds_stats[0]["bs"]
test_stats["bs_min"] = min([t["bs"] for t in builds_stats])
test_stats["bs_max"] = max([t["bs"] for t in builds_stats])
test_stats["bs_dev"] = math.sqrt(sum([t["bs"]**2 for t in builds_stats])/num)
test_stats["as_avg"] = sum([t["as"] for t in builds_stats])/num
test_stats["as_last"] = builds_stats[0]["as"]
test_stats["as_min"] = min([t["as"] for t in builds_stats])
test_stats["as_max"] = max([t["as"] for t in builds_stats])
test_stats["as_dev"] = math.sqrt(sum([t["as"]**2 for t in builds_stats])/num)
test_stats["tags_bs_avg"] = sum([t["tags_bs"] for t in builds_stats])/num
test_stats["tags_bs_last"] = builds_stats[0]["tags_bs"]
test_stats["tags_bs_min"] = min([t["tags_bs"] for t in builds_stats])
test_stats["tags_bs_max"] = max([t["tags_bs"] for t in builds_stats])
test_stats["tags_bs_dev"] = math.sqrt(sum([t["tags_bs"]**2 for t in builds_stats])/num)
test_stats["tags_as_avg"] = sum([t["tags_as"] for t in builds_stats])/num
test_stats["tags_as_last"] = builds_stats[0]["tags_as"]
test_stats["tags_as_min"] = min([t["tags_as"] for t in builds_stats])
test_stats["tags_as_max"] = max([t["tags_as"] for t in builds_stats])
test_stats["tags_as_dev"] = math.sqrt(sum([t["tags_as"]**2 for t in builds_stats])/num)
......
......@@ -128,7 +128,7 @@
if ("project" in state && !load_all) {
projs = projects.filter(function (p) { return p.project ==state.project; });
}
if(("tests" in state || "tags" in state) && !("search" in state) && projs.length > 1) {
if(("tests" in state || "tags" in state) && !("search" in state) && !("project" in state)) {
alert("Please filter out some results first, or browser might crash!");
return;
}
......@@ -421,11 +421,11 @@
$(td).append('<span class="text-danger">' + test.num_fail + ' </span>');
$(td).append('<span class="text-secondary">' + test.num_skip + ' </span>');
$(tr).append(td);
$(tr).append($("<td></td>").append(format_time_stats(test.time_avg, test.time_min, test.time_max, test.time_dev)));
$(tr).append($("<td></td>").append(format_time_stats(test.bs_avg, test.bs_min, test.bs_max, test.bs_dev)));
$(tr).append($("<td></td>").append(format_time_stats(test.tags_bs_avg, test.tags_bs_min, test.tags_bs_max, test.tags_bs_dev)));
$(tr).append($("<td></td>").append(format_time_stats(test.as_avg, test.as_min, test.as_max, test.as_dev)));
$(tr).append($("<td></td>").append(format_time_stats(test.tags_as_avg, test.tags_as_min, test.tags_as_max, test.tags_as_dev)));
$(tr).append($("<td></td>").append(format_time_stats(test.time_avg, test.time_last, test.time_min, test.time_max, test.time_dev)));
$(tr).append($("<td></td>").append(format_time_stats(test.bs_avg, test.bs_last, test.bs_min, test.bs_max, test.bs_dev)));
$(tr).append($("<td></td>").append(format_time_stats(test.tags_bs_avg, test.tags_bs_last, test.tags_bs_min, test.tags_bs_max, test.tags_bs_dev)));
$(tr).append($("<td></td>").append(format_time_stats(test.as_avg, test.as_last, test.as_min, test.as_max, test.as_dev)));
$(tr).append($("<td></td>").append(format_time_stats(test.tags_as_avg, test.tags_as_last, test.tags_as_min, test.tags_as_max, test.tags_as_dev)));
$(tbody).append(tr);
});
}
......@@ -458,13 +458,13 @@
$(tr).append('<td>'+tag.bs_num+'</td>')
$(tr).append('<td>'+tag.as_num+'</td>')
if(tag.bs_num) {
$(tr).append($("<td></td>").append(format_time_stats(tag.bs_avg, tag.bs_min, tag.bs_max, tag.bs_dev)));
$(tr).append($("<td></td>").append(format_time_stats(tag.bs_avg, undefined, tag.bs_min, tag.bs_max, tag.bs_dev)));
}
else {
$(tr).append("<td>&nbsp;</td>");
}
if(tag.as_num) {
$(tr).append($("<td></td>").append(format_time_stats(tag.as_avg, tag.as_min, tag.as_max, tag.as_dev)));
$(tr).append($("<td></td>").append(format_time_stats(tag.as_avg, undefined, tag.as_min, tag.as_max, tag.as_dev)));
}
else {
$(tr).append("<td>&nbsp;</td>");
......@@ -474,12 +474,15 @@
}
function format_time_stats(avg, min, max, dev) {
function format_time_stats(avg, last, min, max, dev) {
var tb = $('<table style="font-size:0.8rem; line-height:0.85rem;"></table>');
$(tb).append('<tr><td>avg:</td><th>'+avg.toFixed(2)+'</th></tr>')
$(tb).append('<tr><td>min:</td><td>'+min.toFixed(2)+'</td></tr>')
$(tb).append('<tr><td>max:</td><td>'+max.toFixed(2)+'</td></tr>')
$(tb).append('<tr><td>&sigma;:</td><td>'+dev.toFixed(2)+'</td></tr>')
$(tb).append('<tr><td>avg:</td><th>'+avg.toFixed(2)+'</th></tr>');
if (last !== undefined) {
$(tb).append('<tr><td>last:</td><td>'+last.toFixed(2)+'</td></tr>');
}
$(tb).append('<tr><td>min:</td><td>'+min.toFixed(2)+'</td></tr>');
$(tb).append('<tr><td>max:</td><td>'+max.toFixed(2)+'</td></tr>');
$(tb).append('<tr><td>&sigma;:</td><td>'+dev.toFixed(2)+'</td></tr>');
return tb;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment