blob: d372b2902dcffc0ea4d9bc64b69a244b845e3d2d [file] [log] [blame]
%# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
%# Use of this source code is governed by a BSD-style license that can be
%# found in the LICENSE file.
%def body_block():
<h2 style="text-align:center">ChromeOS Local Test Results</h2>
%if not test_results:
<h3><u>No test results found.</u></h3>
<p>Check the <u><i>result_viewer</i></u> log messages and ensure that
<u><i>test_results.json</i></u> is present and has valid json (generated by local_dash).</p>
%end
%# --------------------------------------------------------------------------
%# LEGEND
<div align="center">
<table class="info">
<tr>
<td>Legend:&nbsp;&nbsp;</td>
<td class='legend success'
title='All tests passed'>Passed</td>
<td class='legend failure'
title='There is a new failure. Take a look!'>Failed</td>
<td class='legend testna'
title='The test is not applicable.'>Test N/A</td>
<td class='legend notstarted'
title='Test not run.'>No&nbsp;data</td>
</tr>
</table>
</div>
<hr>
%# --------------------------------------------------------------------------
%# Jump table to anchors for different hardware represented
<table width="100%">
<tr>
%for hardware in test_results['hardware']:
<td>
<a href="#{{hardware}}" title="jump to results for '{{hardware}}'">{{hardware}}</a>
</td>
%end
</tr>
</table>
<hr>
%# --------------------------------------------------------------------------
%# A table for each hardware type
%for hardware in test_results['hardware']:
<b><u><a name="{{hardware}}">{{hardware}}</a></u></b>&nbsp;&nbsp;
<a href="#pagetop" title="jump back to the top of the page">Top</a><br>
<div align="center">
<table width="96%">
%# First row is a header row
<tr>
<td width="1%">Test Date</td>
<td class="DevSlave Alt last">
<table width="100%">
<tr>
%for test_name in test_results['tests']:
<td><div class="TestName"><div class="TestNameDiv">{{test_name}}
</div></div></td>
%end
</tr>
</table>
</td>
</tr>
%# ----------------------------------------------------------------------
%# Subsequent rows are: date | test results (pass, fail, not run)
%for result_dict in test_results['results']:
%if result_dict.setdefault('dut', {}).get('hwid') == hardware:
%dut_info = 'ec: %s<br>' % (
% result_dict['dut'].get('fw_version', 'unknown_ec'))
%dut_info += ' bios: %s<br>' % (
% result_dict['dut'].get('fwid', 'unknown_bios'))
<tr>
<td width="1%">
<a class="info"
onmouseover="fixTooltip(event, this)"
onmouseout="clearTooltip(this)"
href="/logs/{{result_dict['path']}}/">
{{result_dict['localtime']}}
<span>
{{result_dict['path']}}
%fail_set = set()
%pass_set = set()
%for test_result_dict in result_dict['tests']:
%test_name = test_result_dict.get('name')
%if test_result_dict.get('status') != 'PASS':
%fail_set.add(test_name)
%else:
%pass_set.add(test_name)
%end
%end
%if fail_set:
<div style="color:red;">
Failed tests: {{', '.join(sorted(fail_set))}}.
</div>
%end
%fail_set.discard('firmware_FAFTClient')
%pass_set.discard('firmware_FAFTClient')
%if len(pass_set):
{{ len(pass_set) }} tests passed.
%end
%if len(fail_set):
{{ len(fail_set) }} tests failed.
%end
</span>
</a>
</td>
<td class="DevSlave Alt last">
<table width="100%">
<tr>
%for test_name in test_results['tests']:
<td class="DevSlaveBox">
%test_ran = False
%for test_result_dict in result_dict['tests']:
%if test_name != 'firmware_FAFTClient' and test_name == test_result_dict.get('name'):
%# notstarted - empty
%# running - yellow
%# success - green
%# failure - red
%test_ran = True
<a href="/logs/{{test_result_dict['path']}}/"
target="_blank"
onmouseover="fixTooltip(event, this)"
onmouseout="clearTooltip(this)"
%if test_result_dict.get('status') == 'PASS':
class="info DevSlaveBox success">
<span>
<b>{{test_name}}</b><br>
{{!dut_info}}
</span>
%else:
%if test_result_dict.get('reason', 'no reason')[8:15] == 'TEST_NA':
class="info DevSlaveBox testna">
%else:
class="info DevSlaveBox failure">
%end
<span>
<b>{{test_name}}</b><br>
{{!dut_info}}
<div style="color:red;">
{{test_result_dict.get('reason', 'no reason')}}
</div>
</span>
%end
</a>
%end
%end
%if not test_ran:
<a class="info DevSlaveBox notstarted"
onmouseover="fixTooltip(event, this)"
onmouseout="clearTooltip(this)">
<span>
<b>{{test_name}}</b><br>
{{!dut_info}}
</span>
</a>
%end
</td>
%end
</tr>
</table>
</td>
</tr>
%end
%end
</table>
</div>
<hr>
%end
</div>
%end
%rebase master {'title': 'tests', 'body_block': body_block}