diff options
author | Juha Sippola <juhasippola@outlook.com> | 2015-09-21 15:15:18 +0300 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@theqtcompany.com> | 2015-09-23 09:38:09 +0000 |
commit | 787465ad37eabef9cb83fdb56954025a301422e6 (patch) | |
tree | d947c0e63868d0cffd3fda455134d8767811615e /non-puppet/qtmetrics2/templates | |
parent | cc1bb3968b1aa9795309bf3514595dc286e5bf27 (diff) |
Qt Metrics 2 (v0.21): Testset testfunctions page
New page to list failed and skipped testfunctions
for a selected testset in selected configuration.
Change-Id: I9612ec4cd8b5ff829f0b8faf7f973345797d7daa
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 | 4 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/testset_testfunctions.html | 288 |
2 files changed, 290 insertions, 2 deletions
diff --git a/non-puppet/qtmetrics2/templates/about.html b/non-puppet/qtmetrics2/templates/about.html index e8b7dd2..9eb5d0e 100644 --- a/non-puppet/qtmetrics2/templates/about.html +++ b/non-puppet/qtmetrics2/templates/about.html @@ -34,7 +34,7 @@ /** * About window content - * @since 19-08-2015 + * @since 08-09-2015 * @author Juha Sippola */ @@ -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.20 (19-Aug-2015)</small></p> +<p><small>Version 0.21 (8-Sep-2015)</small></p> diff --git a/non-puppet/qtmetrics2/templates/testset_testfunctions.html b/non-puppet/qtmetrics2/templates/testset_testfunctions.html new file mode 100644 index 0000000..6f6317c --- /dev/null +++ b/non-puppet/qtmetrics2/templates/testset_testfunctions.html @@ -0,0 +1,288 @@ +{# +############################################################################# +## +## 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$ +## +############################################################################# + +/** + * Testfunctions page + * @since 08-09-2015 + * @author Juha Sippola + */ + +#} + +{% include "header.html" %} + +{# testset as Testset object +/** + * @var Testset[] testset + */ +#} + +{# projectRuns as ProjectRun objects +/** + * @var ProjectRun[] projectRuns + */ +#} + +{# testfunctionRuns as TestfunctionRun objects +/** + * @var TestfunctionRun[] testfunctionRuns + */ +#} + +<ol class="breadcrumb"> +{% for link in breadcrumb %} +<li><a href="{{ link.link }}">{{ link.name }}</a></li> +{% endfor %} +<li class="active">testfunctions</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 testfunctionRuns %} +{% set runsAvailable = 1 %} +{% endfor %} + +{##### Title #####} + +<h1 class="page-header"> +{{ testset.getName }} +<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>Testset</strong><br> +<ul> +<li><strong>Testfunction Results in Branches</strong> shows the {{ testset.getName }} <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 testfunction on the latest build shown</li> +<li>results: <span class="glyphicon glyphicon-remove red"></span> = {{ constant('TestfunctionRun::RESULT_FAILURE') }}, +<span class="glyphicon glyphicon-ok-sign red"></span> = {{ constant('TestfunctionRun::RESULT_SUCCESS_UNEXPECTED') }}, +<span class="glyphicon glyphicon-remove-sign green"></span> = {{ constant('TestfunctionRun::RESULT_FAILURE_EXPECTED') }}, +<span class="glyphicon glyphicon-ban-circle gray"></span> = {{ constant('TestfunctionRun::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">Testfunction 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 testfunction run for this branch #} +{% set testfunctionBranch = 0 %} +{% for run in testfunctionRuns if run.getBranchName == branch %} +{% set testfunctionBranch = 1 %} +{% endfor %} + +{# Show branch if testfunction run for it #} +{% if testfunctionBranch %} +<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">{{ testset.getName }}</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 testfunctionPrev = '' %} +{% set buildKeyIndexPrinted = -1 %} +{% set buildKeyFound = 0 %} +{% for run in testfunctionRuns if run.getBranchName == branch %} + +{# New row for each testfunction #} +{% if testfunctionPrev != run.getName %} +{# Close previous row #} +{% if testfunctionPrev != '' %} +{# Fill empty cells at the end of the row #} +{% for key, buildKey in buildKeys %} +{% if key > buildKeyIndexPrinted %} +<td></td> +{% endif %} +{% endfor %} +</tr> +{% endif %} +<tr> +{% set link = testfunctionRoute ~ '/' ~ run.getName|url_encode ~ '/' ~ testset.getName|url_encode ~ '/' ~ testset.getProjectName|url_encode ~ '/' ~ run.getConfName|url_encode %} +<td><a href="{{ link }}"><small> +{% if run.getName|length > constant('TestfunctionRun::SHORT_NAME_LENGTH') %} +<span class="clickOnTouch" data-toggle="tooltip" data-placement="top" title="{{ run.getName }}">{{ run.getShortName }}</span> +{% else %} +{{ run.getName }} +{% endif %} +</small></a></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>Duration: </th><td>{{ run.getDuration / 10 }} s {{ durationFormatted }}</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 testfunctionPrev = 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 %}{# testfunctionBranch #} +{% endfor %}{# branch #} + +{% else %}{# runsAvailable #} +<div class="alert alert-success" role="alert"> +No failed or skipped testfunctions in testset {{ testset.getName }} in project {{ testset.getProjectName }} and 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" %} |