Fix bug with interactive report and SLA failures

This commit is to fix a bug where a test will fail due to the SLA not
being met but the interactive html report shows 'success'. This fixes
interactive html report to show 'sla fail'.

Change-Id: Ief30bf5125013805e3aef75f74a892e71c41ea6e
Closes-Bug: 1801972
This commit is contained in:
Oded Le'Sage 2018-11-06 10:41:56 -06:00
parent abe9fbd877
commit 5f84721040
1 changed files with 15 additions and 0 deletions

View File

@ -451,6 +451,13 @@
parseUrlToState();
console.log(state);
// change the status of tests that have sla failures
// to "fail", only if they were previously marked "ok"
$.each(report.sla, function(_i, sla) {
if (sla.state == "FAIL" && report.records[sla.record].status == "ok") {
report.records[sla.record].status = "fail";
}
});
// pre-process records
$.each(report.records, function(_i, record) {
if (record.status) {
@ -458,6 +465,7 @@
record["is_status_lost"] = record.status == "lost";
record["is_status_interrupted"] = record.status == "interrupted";
record["is_status_error"] = record.status == "error";
record["is_status_fail"] = record.status == "fail";
}
});
@ -545,6 +553,7 @@
{{#if is_status_lost}}<span class="label label-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>lost</span>{{/if}}
{{#if is_status_interrupted}}<span class="label label-warning"><span class="glyphicon glyphicon-stop" aria-hidden="true"></span>interrupted</span>{{/if}}
{{#if is_status_error}}<span class="label label-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>error</span>{{/if}}
{{#if is_status_fail}}<span class="label label-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>sla fail</span>{{/if}}
{{#if stats_yaml}}
<h4>Stats</h4>
<pre>{{ stats_yaml }}</pre>
@ -639,6 +648,12 @@
error
</span>
{{/if}}
{{#if is_status_fail }}
<span class="label label-danger">
<span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
sla fail
</span>
{{/if}}
</td>
</tr>
{{/records}}