diff options
Diffstat (limited to 'non-puppet/qtmetrics2/templates/testsets_duration_data.html')
-rw-r--r-- | non-puppet/qtmetrics2/templates/testsets_duration_data.html | 183 |
1 files changed, 183 insertions, 0 deletions
diff --git a/non-puppet/qtmetrics2/templates/testsets_duration_data.html b/non-puppet/qtmetrics2/templates/testsets_duration_data.html new file mode 100644 index 0000000..59497d9 --- /dev/null +++ b/non-puppet/qtmetrics2/templates/testsets_duration_data.html @@ -0,0 +1,183 @@ +{# +############################################################################# +## +## 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$ +## +############################################################################# + +/** + * Top duration (testsets and testfunctions) data + * @since 24-09-2015 + * @author Juha Sippola + */ + +#} + +{# Failed/passed bar area size in px #} +{% set BAR_AREA = 120 %} + +{# runs as TestsetRun objects +/** + * @var TestsetRun[] runs + */ +#} +{# runs as TestfunctionRun objects +/** + * @var TestfunctionRun[] runs + */ +#} + +{##### List #####} + +{# Calculate max duration for the bar #} +{% set runCount = 0 %} +{% set maxDuration = 1 %} +{% for run in runs %} +{% set runCount = runCount + 1 %} +{% if run.getDuration > maxDuration %} +{% set maxDuration = run.getDuration %} +{% endif %} +{% endfor %} + +<div class="panel panel-primary"> +<div class="panel-heading"> +<h4 class="panel-title bold">Last {{ lastDays }} days <small>(since {{ sinceDate }}, duration over {{ durationLimitSec }}s)</small></h4> +</div> + +{% if runCount > 0 %} + +<div class="panel-body"> +<div class="table-responsive"> +<table class="table table-striped"> +<thead> +<tr> +{% if list == 'testsets' %} +<th>testset</th> +{% else %} +<th>test function</th> +{% endif %} +<th class="leftBorder center">duration</th> +<th class="showInLargeDisplay"></th> +<th class="leftBorder">build information</th> +</tr> +</thead> +<tbody> + +{# Print testsets #} +{% for run in runs %} +<tr> +{# Testset and project name#} +{% if list == 'testsets' %} +{% set link = testsetRoute ~ '/' ~ run.getName|url_encode ~ '/' ~ run.getTestsetProjectName|url_encode %} +<td><a href="{{ link }}"> +{% if run.getName|length > constant('TestsetRun::SHORT_NAME_LENGTH') %} +<span class="clickOnTouch" data-toggle="tooltip" data-placement="top" title="{{ run.getName }}">{{ run.getShortName }}</span> +{% else %} +{{ run.getShortName }} +{% endif %} +</a><br>in {{ run.getTestsetProjectName }}</td> + +{# Testfunction name #} +{% else %} +<td> +{% if run.getName|length > constant('TestsetRun::SHORT_NAME_LENGTH') %} +<span class="clickOnTouch" data-toggle="tooltip" data-placement="top" title="{{ run.getName }}">{{ run.getShortName }}</span> +{% else %} +{{ run.getShortName }} +{% endif %} +</td> +{% endif %} + +{# Duration #} +{% if run.getDuration > 60 %} +{% set durationFormatted = ' (00:' ~ (run.getDuration|round)|date("i:s") ~ ')' %} +{% else %} +{% set durationFormatted = '' %} +{% endif %} +<td class="leftBorder center">{{ run.getDuration }}s<br>{{ durationFormatted }}</td> + +{# Show results as bars (scaled to BAR_AREA px) #} +{% set bar = ((BAR_AREA/maxDuration) * run.getDuration)|round(0, 'floor') %} +{% if (run.getDuration > 0) and (bar == 0) %} +{% set bar = 1 %} +{% endif %} +<td class="center showInLargeDisplay"> +<div> +<div class="floatLeft blueBackground" style="width: {{ bar }}px"> </div> +</div> +</td> +{# Build info #} +{% if run.getResult == constant('testsetRun::RESULT_SUCCESS') %} +{% set resultIcon = 'glyphicon glyphicon-ok green' %} +{% elseif run.getResult == constant('testsetRun::RESULT_FAILURE') %} +{% set resultIcon = 'glyphicon glyphicon-remove red' %} +{% elseif run.getResult == constant('TestfunctionRun::RESULT_SUCCESS') %} +{% set resultIcon = 'glyphicon glyphicon-ok green' %} +{% elseif 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 list == 'testsets' %} +{% set resultTitle = 'testset result: ' ~ run.getResult %} +{% else %} +{% set resultTitle = 'test function result: ' ~ run.getResult %} +{% endif %} +<td class="leftBorder"><small> +<span class="clickOnTouch" data-toggle="tooltip" data-placement="top" title="{{ resultTitle }}"><span class="{{ resultIcon }}"></span></span> +<a href="{{ run.getBuildLink }}" target="_blank"><span class="spaceHorizontal glyphicon glyphicon-folder-open"></span></a> +{{ run.getBranchName }} build on {{ run.getTimestamp }} +<br>{{ run.getConfName }}</small></td> +</tr> +{% endfor %}{# run #} +</tbody> +</table> +</div> {# .table-responsive #} +</div> {# .panel-body #} + +{% endif %}{# runCount #} +</div> {# .panel... #} + +{% if runCount == 0 %} +<div class="alert alert-info" role="alert"> +{% if list == 'testsets' %} +There are not any testsets with duration less than {{ durationLimitSec }}s since {{ sinceDate }}! +{% else %} +The testset {{ testset }} ({{ project }}) either does not have any {{ list }}, +or the duration of all {{ list }} since {{ sinceDate }} is less than {{ durationLimitSec }}s! +{% endif %} +</div> +{% endif %}{# runCount #} |