diff options
author | Juha Sippola <juhasippola@outlook.com> | 2015-09-21 15:39:07 +0300 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@theqtcompany.com> | 2015-09-23 09:38:28 +0000 |
commit | 096b99cdfc4f6ee17a09aa09c77a650be4877e06 (patch) | |
tree | 46d9859c2bcbc532f284390056d5b7addc58a9e6 /non-puppet/qtmetrics2/templates | |
parent | 76dc840d91d4e51cf7cbf447147af1fc2eff753e (diff) |
Qt Metrics 2 (v0.23): Testfunction page
New page to list failed or skipped testrows for
selected testfunction in selected testset and
configuration.
Change-Id: I64e7b7acf1a6001c08d0f11460f063bef279d607
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
Diffstat (limited to 'non-puppet/qtmetrics2/templates')
-rw-r--r-- | non-puppet/qtmetrics2/templates/about.html | 2 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/testfunction.html | 280 |
2 files changed, 281 insertions, 1 deletions
diff --git a/non-puppet/qtmetrics2/templates/about.html b/non-puppet/qtmetrics2/templates/about.html index 7c37008..5f83d77 100644 --- a/non-puppet/qtmetrics2/templates/about.html +++ b/non-puppet/qtmetrics2/templates/about.html @@ -43,4 +43,4 @@ <p>This is Qt Metrics revision 2 with redesigned UI and database.</p> <p>These pages are still <strong>under construction</strong> and therefore the views and functionality is limited.</p> <p>See the <a href="https://wiki.qt.io/Qt_Metrics_2_Backlog" target="_blank">backlog</a> for development items currently identified or in progress.</p> -<p><small>Version 0.22 (9-Sep-2015)</small></p> +<p><small>Version 0.23 (9-Sep-2015)</small></p> diff --git a/non-puppet/qtmetrics2/templates/testfunction.html b/non-puppet/qtmetrics2/templates/testfunction.html new file mode 100644 index 0000000..6c1f616 --- /dev/null +++ b/non-puppet/qtmetrics2/templates/testfunction.html @@ -0,0 +1,280 @@ +{# +############################################################################# +## +## Copyright (C) 2015 The Qt Company Ltd. +## Contact: http://www.qt.io/licensing/ +## +## This file is part of the Quality Assurance module of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL21$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see http://www.qt.io/terms-conditions. For further +## information use the contact form at http://www.qt.io/contact-us. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## As a special exception, The Qt Company gives you certain additional +## rights. These rights are described in The Qt Company LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## $QT_END_LICENSE$ +## +############################################################################# + +/** + * Testfunction page + * @since 09-09-2015 + * @author Juha Sippola + */ + +#} + +{% include "header.html" %} + +{# projectRuns as ProjectRun objects +/** + * @var ProjectRun[] projectRuns + */ +#} + +{# testrowRuns as TestrowRun objects +/** + * @var TestrowRun[] testrowRuns + */ +#} + +<ol class="breadcrumb"> +{% for link in breadcrumb %} +<li><a href="{{ link.link }}">{{ link.name }}</a></li> +{% endfor %} +<li class="active">{{ testfunction }}</li> +</ol> + +<div class="container-fluid"> +<div class="row"> + +<div class="col-sm-12 col-md-12 main"> + +{# Check if any runs available #} +{% set runsAvailable = 0 %} +{% for run in testrowRuns %} +{% set runsAvailable = 1 %} +{% endfor %} + +{##### Title #####} + +<h1 class="page-header"> +{{ testfunction }} +<button type="button" class="btn btn-xs btn-info" data-toggle="collapse" data-target="#info" aria-expanded="false" aria-controls="info"> +<span class="glyphicon glyphicon-info-sign"></span> +</button> +<small>{{ refreshed }}</small> +</h1> + +{##### Info well #####} + +<div class="collapse" id="info"> +<div class="well infoWell"> +<span class="glyphicon glyphicon-info-sign"></span> <strong>Testfunction</strong><br> +<ul> +<li><strong>Testrow Results in Branches</strong> shows the {{ testfunction }} <strong>failed and skipped</strong> results in configuration +{{ conf }} by branch on <strong>{{ masterProject }} {{ masterState }}</strong> builds +<ul> +<li>flags: <span class="label label-default">b</span> = blacklisted flag set for the testrow on the latest build shown</li> +<li>results: <span class="glyphicon glyphicon-remove red"></span> = {{ constant('TestrowRun::RESULT_FAILURE') }}, +<span class="glyphicon glyphicon-ok-sign red"></span> = {{ constant('TestrowRun::RESULT_SUCCESS_UNEXPECTED') }}, +<span class="glyphicon glyphicon-remove-sign green"></span> = {{ constant('TestrowRun::RESULT_FAILURE_EXPECTED') }}, +<span class="glyphicon glyphicon-ban-circle gray"></span> = {{ constant('TestrowRun::RESULT_SKIP') }}</li> +</ul> +</li> +<li>Details on the runs are available as tooltip on result icon</li> +</ul> +</div> +</div> + +{% if runsAvailable %} + +{##### Results in Branches #####} + +<div class="panel panel-primary"> +<div class="panel-heading"> +<h4 class="panel-title bold">Testrow Results in Branches <small>(failures and skipped only)</small></h4> +</div> +</div> + +{# Get branches #} +{% set branches = [] %} +{% for run in projectRuns %} +{% if run.getBranchName not in branches %} +{% set branches = branches|merge([run.getBranchName]) %} +{% endif %} +{% endfor %} + +{# Loop all the branches #} +{% for branch in branches %} + +{# Get all build keys, dates and log links #} +{% set buildKey = '' %} +{% set buildKeys = [] %} +{% set dates = [] %} +{% for run in projectRuns %} +{% if run.getBranchName == branch %} +{% if buildKey != run.getBuildKey %} +{% set buildKey = run.getBuildKey %} +{% set buildKeys = buildKeys|merge([run.getBuildKey]) %} +{% set dates = dates|merge([run.getTimestamp]) %} +{% endif %} +{% endif %} +{% endfor %} + +{# Check if testrow run for this branch #} +{% set testrowBranch = 0 %} +{% for run in testrowRuns if run.getBranchName == branch %} +{% set testrowBranch = 1 %} +{% endfor %} + +{# Show branch if testrow run for it #} +{% if testrowBranch %} +<div class="panel panel-info"> +<div class="panel-heading"> +<h4 class="panel-title bold">{{ branch }}</h4> +</div> +<div class="panel-body"> +<div class="table-responsive"> +<table class="table table-striped"> +<thead> +<tr> +<th class="bold">{{ testfunction }}</th> +<th class="bold rightBorder">flags</th> +{% for key, buildKey in buildKeys %} +<th class="center"> +{% if buildKey|length > 6 %} +<span class="clickOnTouch" data-toggle="tooltip" data-placement="top" title="{{ buildKey }}">{{ buildKey|slice(0, 4) }}...</span><br> +{% else %} +{{ buildKey }}<br> +{% endif %} +<span class="gray"><small>{{ dates[key]|date("m-d") }}</small></span> +</th> +{% endfor %} +</tr> +</thead> +<tbody> +{% set testrowPrev = '' %} +{% set buildKeyIndexPrinted = -1 %} +{% set buildKeyFound = 0 %} +{% for run in testrowRuns if run.getBranchName == branch %} + +{# New row for each testrow #} +{% if testrowPrev != run.getName %} +{# Close previous row #} +{% if testrowPrev != '' %} +{# Fill empty cells at the end of the row #} +{% for key, buildKey in buildKeys %} +{% if key > buildKeyIndexPrinted %} +<td></td> +{% endif %} +{% endfor %} +</tr> +{% endif %} +<tr> +<td><small> +{% if run.getName|length > constant('TestrowRun::SHORT_NAME_LENGTH') %} +<span class="clickOnTouch" data-toggle="tooltip" data-placement="top" title="{{ run.getName }}">{{ run.getShortName }}</span> +{% else %} +{{ run.getName }} +{% endif %} +</small></td> + +{# Flags for the latest build #} +<td class="center rightBorder"> +{% if run.getBlacklisted %} +<span class="label label-default">b</span> +{% endif %} +</td> +{% set buildKeyIndexPrinted = -1 %} +{% endif %} + +{# Result per build key #} +{% set buildKeyFound = 0 %} +{% for key, buildKey in buildKeys %} +{# Print each column only once (checked based on column index key and buildKeyFound flag) #} +{% if key > buildKeyIndexPrinted and not buildKeyFound %} +{% if buildKey == run.getBuildKey %} +{# Print result #} +{% if run.getResult == constant('TestfunctionRun::RESULT_FAILURE') %} +{% set resultIcon = 'glyphicon glyphicon-remove red' %} +{% elseif run.getResult == constant('TestfunctionRun::RESULT_FAILURE_EXPECTED') %} +{% set resultIcon = 'glyphicon glyphicon-remove-sign green' %} +{% elseif run.getResult == constant('TestfunctionRun::RESULT_SUCCESS_UNEXPECTED') %} +{% set resultIcon = 'glyphicon glyphicon-ok-sign red' %} +{% elseif run.getResult == constant('TestfunctionRun::RESULT_SKIP') %} +{% set resultIcon = 'glyphicon glyphicon-ban-circle gray' %} +{% else %} +{% set resultIcon = '' %} +{% endif %} +{% if (run.getDuration / 10) > 60 %} +{% set durationFormatted = ' (00:' ~ ((run.getDuration/10)|round)|date("i:s") ~ ')' %} +{% else %} +{% set durationFormatted = '' %} +{% endif %} +<td class="center"> +<span class="spaceHorizontal {{ resultIcon }} clickOnTouch" data-toggle="tooltip" data-placement="top" data-html="true" +title="<table> +<tr><th>Build key: </th><td>{{ buildKey }}</td></tr> +<tr><th>Configuration: </th><td>{{ run.getConfName }}</td></tr> +<tr><th>Timestamp: </th><td>{{ run.getTimestamp }}</td></tr> +<tr><th>Result: </th><td>{{ run.getResult }}</td></tr> +<tr><th>Blacklisted: </th><td>{% if run.getBlacklisted %}yes{% else %}no{% endif %}</td></tr></table>"> +</span></td> +{% set buildKeyFound = 1 %} +{% else %} +{# Print empty cell #} +<td></td> +{% endif %} +{% set buildKeyIndexPrinted = key %} +{% endif %}{# key #} +{% endfor %}{# key #} +{% set testrowPrev = run.getName %} +{% endfor %}{# run #} + +{# Close last row (also fill empty cells at the end of the row) #} +{% for key, buildKey in buildKeys %} +{% if key > buildKeyIndexPrinted %} +<td></td> +{% endif %} +{% endfor %}{# key #} +</tr> +</tbody> +</table> +</div> {# .table-responsive #} +</div> {# .panel-body #} +</div> {# .panel... #} +{% endif %}{# testrowBranch #} +{% endfor %}{# branch #} + +{% else %}{# runsAvailable #} +<div class="alert alert-success" role="alert"> +No failed or skipped testrows in testfunction {{ testfunction }} in testset {{ testset }} in configuration {{ conf }}! +</div> +{% endif %}{# runsAvailable #} +</div> {# .col... #} +</div> {# .row #} +</div> {# /container-fluid #} + +{% include "footer.html" %} + +{# Local scripts for this page #} +<script src="scripts/tooltip.js"></script> + +{% include "close.html" %} |