diff options
author | Juha Sippola <juhasippola@outlook.com> | 2015-08-05 10:59:15 +0300 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@theqtcompany.com> | 2015-09-16 07:34:25 +0000 |
commit | a0cd197d0df3e9433bcc93b1f5c33599f9c9345b (patch) | |
tree | 0cbc28f6292fb8b7e25b4168447b63fba38db267 | |
parent | 4296e134c0dab7a37e23a86f57afd5f4cdcb4583 (diff) |
Qt Metrics 2 (v0.16): Log file links
Added log file links to the build lists.
Changed passing the project runs as objects
to the template files (instead of arrays).
Change-Id: I1ed889de5b9eb06cb44fc1e18df85a4f61d1de2b
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
-rw-r--r-- | non-puppet/qtmetrics2/index.php | 37 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/styles/qtmetrics.css | 9 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/about.html | 5 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/build_project.html | 29 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/conf.html | 73 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/testset.html | 23 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/testset_project.html | 37 |
7 files changed, 128 insertions, 85 deletions
diff --git a/non-puppet/qtmetrics2/index.php b/non-puppet/qtmetrics2/index.php index 84faf9d..367650d 100644 --- a/non-puppet/qtmetrics2/index.php +++ b/non-puppet/qtmetrics2/index.php @@ -34,8 +34,7 @@ /** * Qt Metrics API - * @version 0.11 - * @since 23-07-2015 + * @since 03-08-2015 * @author Juha Sippola */ @@ -130,9 +129,9 @@ $app->get('/buildproject', function() use($app) 'latestProjectRuns' => Factory::db()->getLatestProjectBranchBuildResults( $ini['master_build_project'], $ini['master_build_state']), - 'projectBuilds' => Factory::db()->getProjectBuildsByBranch( + 'projectRuns' => Factory::createProjectRuns( $ini['master_build_project'], - $ini['master_build_state']), + $ini['master_build_state']), // managed as objects 'project' => Factory::createProject( $ini['master_build_project'], $ini['master_build_project'], @@ -175,9 +174,9 @@ $app->get('/buildproject/platform/:targetOs', function($targetOs) use($app) 'latestProjectRuns' => Factory::db()->getLatestProjectBranchBuildResults( $ini['master_build_project'], $ini['master_build_state']), - 'projectBuilds' => Factory::db()->getProjectBuildsByBranch( + 'projectRuns' => Factory::createProjectRuns( $ini['master_build_project'], - $ini['master_build_state']), + $ini['master_build_state']), // managed as objects 'project' => Factory::createProject( $ini['master_build_project'], $ini['master_build_project'], @@ -215,9 +214,9 @@ $app->get('/testsetproject/:project', function($project) use($app) $project, $ini['master_build_project'], $ini['master_build_state']), - 'projectBuilds' => Factory::db()->getProjectBuildsByBranch( + 'projectRuns' => Factory::createProjectRuns( $ini['master_build_project'], - $ini['master_build_state']), + $ini['master_build_state']), // managed as objects 'confBuilds' => Factory::db()->getTestsetProjectResultsByBranchConf( $project, $ini['master_build_project'], @@ -249,14 +248,14 @@ $app->get('/conf/:conf', function($conf) use($app) 'refreshed' => Factory::db()->getDbRefreshed() . ' (GMT)', 'masterProject' => $ini['master_build_project'], 'masterState' => $ini['master_build_state'], - 'projectBuilds' => Factory::db()->getProjectBuildsByBranch( - $ini['master_build_project'], - $ini['master_build_state']), 'testsetProject' => '', 'latestConfRuns' => Factory::db()->getLatestConfBranchBuildResults( $conf, $ini['master_build_project'], $ini['master_build_state']), + 'projectRuns' => Factory::createProjectRuns( + $ini['master_build_project'], + $ini['master_build_state']), // managed as objects 'conf' => Factory::createConf( $conf, $ini['master_build_project'], @@ -298,16 +297,20 @@ $app->get('/conf/:conf/:testsetproject', function($conf, $testsetProject) use($a 'refreshed' => Factory::db()->getDbRefreshed() . ' (GMT)', 'masterProject' => $ini['master_build_project'], 'masterState' => $ini['master_build_state'], - 'projectBuilds' => Factory::db()->getProjectBuildsByBranch( - $ini['master_build_project'], - $ini['master_build_state']), 'testsetProject' => $testsetProject, 'latestConfRuns' => null, // not used + 'projectRuns' => Factory::createProjectRuns( + $ini['master_build_project'], + $ini['master_build_state']), // managed as objects 'conf' => Factory::createConf( $conf, $ini['master_build_project'], $ini['master_build_state']), // managed as object - 'confRuns' => null, // not used + 'confRuns' => Factory::createConfRuns( + $ini['master_build_project'], + $ini['master_build_state'], + '', + $conf), // managed as objects 'testsetRuns' => Factory::createTestsetRunsInConf( $conf, $testsetProject, @@ -399,9 +402,9 @@ $app->get('/testset/:testset/:project', function($testset, $project) use($app) 'sinceDateFlaky' => Factory::getSinceDate(intval($ini['flaky_testsets_last_days']) - 1), 'masterProject' => $ini['master_build_project'], 'masterState' => $ini['master_build_state'], - 'projectBuilds' => Factory::db()->getProjectBuildsByBranch( + 'projectRuns' => Factory::createProjectRuns( $ini['master_build_project'], - $ini['master_build_state']), + $ini['master_build_state']), // managed as objects 'testset' => Factory::createTestset( $testset, $project, diff --git a/non-puppet/qtmetrics2/styles/qtmetrics.css b/non-puppet/qtmetrics2/styles/qtmetrics.css index 97a3ad6..58bcee3 100644 --- a/non-puppet/qtmetrics2/styles/qtmetrics.css +++ b/non-puppet/qtmetrics2/styles/qtmetrics.css @@ -35,8 +35,7 @@ /** * Qt Metrics style sheet - * @version 0.4 - * @since 10-07-2015 + * @since 03-08-2015 * @author Juha Sippola */ @@ -149,6 +148,9 @@ .center { text-align: center } +thead { + white-space: nowrap; +} /* * Coloring @@ -162,6 +164,9 @@ .gray { color: gray; } +.blue { + color: #337AB7; +} .greenBackground { background-color: lightgreen; } diff --git a/non-puppet/qtmetrics2/templates/about.html b/non-puppet/qtmetrics2/templates/about.html index c61406d..09fdb43 100644 --- a/non-puppet/qtmetrics2/templates/about.html +++ b/non-puppet/qtmetrics2/templates/about.html @@ -34,8 +34,7 @@ /** * About window content - * @version 0.15 - * @since 23-07-2015 + * @since 03-08-2015 * @author Juha Sippola */ @@ -44,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.15 (23-Jul-2015)</small></p> +<p><small>Version 0.16 (03-Aug-2015)</small></p> diff --git a/non-puppet/qtmetrics2/templates/build_project.html b/non-puppet/qtmetrics2/templates/build_project.html index e4c841e..5f51f0c 100644 --- a/non-puppet/qtmetrics2/templates/build_project.html +++ b/non-puppet/qtmetrics2/templates/build_project.html @@ -34,8 +34,7 @@ /** * Build project page - * @version 0.4 - * @since 20-07-2015 + * @since 03-08-2015 * @author Juha Sippola */ @@ -116,6 +115,7 @@ in one or in several builds).</li> <li><strong>Results in Branches</strong> shows the {{ project.getName }} run results by branch and their configuration on <strong>{{ masterProject }} {{ masterState }}</strong> builds <ul> +<li>log file: <span class="glyphicon glyphicon-file blue"></span> = link to build log file</li> <li>flags: <span class="label label-success">f</span> = forcesuccess and <span class="label label-default">i</span> = insignificant flag set for the configuration on the latest build</li> <li>results: <span class="glyphicon glyphicon-ok green"></span> = {{ constant('ConfRun::RESULT_SUCCESS') }}, @@ -200,25 +200,27 @@ title="<table> {# Get branches #} {% set branches = [] %} -{% for run in projectBuilds %} -{% if run.branch not in branches %} -{% set branches = branches|merge([run.branch]) %} +{% 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 #} +{# Get all build keys, dates and log links #} {% set buildKey = '' %} {% set buildKeys = [] %} {% set dates = [] %} -{% for run in projectBuilds %} -{% if run.branch == branch %} -{% if buildKey != run.buildKey %} -{% set buildKey = run.buildKey %} -{% set buildKeys = buildKeys|merge([run.buildKey]) %} -{% set dates = dates|merge([run.timestamp]) %} +{% set logLinks = [] %} +{% 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]) %} +{% set logLinks = logLinks|merge([run.getLogLink]) %} {% endif %} {% endif %} {% endfor %} @@ -249,7 +251,8 @@ title="<table> {% else %} {{ buildKey }}<br> {% endif %} -<span class="gray"><small>{{ dates[key]|date("m-d") }}</small></span> +<span class="gray"><small>{{ dates[key]|date("m-d") }}</small></span><br> +<a href="{{ logLinks[key] }}" target="_blank"><span class="glyphicon glyphicon-file"></span></a> </th> {% endfor %} </tr> diff --git a/non-puppet/qtmetrics2/templates/conf.html b/non-puppet/qtmetrics2/templates/conf.html index 3908be0..63d3d3d 100644 --- a/non-puppet/qtmetrics2/templates/conf.html +++ b/non-puppet/qtmetrics2/templates/conf.html @@ -34,8 +34,7 @@ /** * Configuration page - * @version 0.1 - * @since 21-07-2015 + * @since 03-08-2015 * @author Juha Sippola */ @@ -102,6 +101,7 @@ and the <strong>branch</strong> results in each branch (both show failed if fail <li><strong>Build Results in Branches</strong> shows the results of {{ conf.getName }} builds by branch on <strong>{{ masterProject }} {{ masterState }}</strong> builds <ul> +<li>log file: <span class="glyphicon glyphicon-file blue"></span> = link to configuration build log file</li> <li>flags: <span class="label label-success">f</span> = forcesuccess and <span class="label label-default">i</span> = insignificant flag set for the configuration on the latest build</li> <li>results: <span class="glyphicon glyphicon-ok green"></span> = {{ constant('ConfRun::RESULT_SUCCESS') }}, @@ -114,6 +114,7 @@ and the <strong>branch</strong> results in each branch (both show failed if fail <li><strong>Testset Results in Branches</strong> shows the testset <strong>failures</strong> in {{ conf.getName }} by branch on <strong>{{ masterProject }} {{ masterState }}</strong> builds <ul> +<li>log file: <span class="glyphicon glyphicon-file blue"></span> = link to configuration build log file</li> <li>flags: <span class="label label-default">i</span> = insignificant flag set for the testset on the latest build</li> <li>results: <span class="glyphicon glyphicon-remove red"></span> = {{ constant('TestsetRun::RESULT_FAILURE') }}</li> </ul> @@ -216,9 +217,9 @@ title="insignificant">i</span> {# Get branches #} {% set branches = [] %} -{% for run in projectBuilds %} -{% if run.branch not in branches %} -{% set branches = branches|merge([run.branch]) %} +{% for run in projectRuns %} +{% if run.getBranchName not in branches %} +{% set branches = branches|merge([run.getBranchName]) %} {% endif %} {% endfor %} @@ -228,7 +229,7 @@ title="insignificant">i</span> {% set confRunsAvailable = 1 %} {% endfor %} -{% if confRunsAvailable %} +{% if confRunsAvailable and (testsetProject == '') %} <div class="panel panel-primary"> <div class="panel-heading"> @@ -239,16 +240,25 @@ title="insignificant">i</span> {# Loop all the branches #} {% for branch in branches %} -{# Get all build keys #} +{# Get all build keys, dates and log links #} {% set buildKey = '' %} {% set buildKeys = [] %} {% set dates = [] %} -{% for run in projectBuilds %} -{% if run.branch == branch %} -{% if buildKey != run.buildKey %} -{% set buildKey = run.buildKey %} -{% set buildKeys = buildKeys|merge([run.buildKey]) %} -{% set dates = dates|merge([run.timestamp]) %} +{% set logLinks = [] %} +{% 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]) %} +{% set confRunFound = 0 %} +{% for confRun in confRuns if (confRun.getBranchName == branch) and (confRun.getBuildKey == buildKey) %} +{% set logLinks = logLinks|merge([confRun.getLogLink]) %} +{% set confRunFound = 1 %} +{% endfor %} +{% if not confRunFound %} +{% set logLinks = logLinks|merge(['']) %} +{% endif %} {% endif %} {% endif %} {% endfor %} @@ -279,7 +289,12 @@ title="insignificant">i</span> {% else %} {{ buildKey }}<br> {% endif %} -<span class="gray"><small>{{ dates[key]|date("m-d") }}</small></span> +<span class="gray"><small>{{ dates[key]|date("m-d") }}</small></span><br> +{% if logLinks[key] != '' %} +<a href="{{ logLinks[key] }}" target="_blank"><span class="glyphicon glyphicon-file"></span></a> +{% else %} + +{% endif %} </th> {% endfor %} </tr> @@ -403,16 +418,25 @@ title="<table> {# Loop all the branches #} {% for branch in branches %} -{# Get all build keys #} +{# Get all build keys, dates and conf log links #} {% set buildKey = '' %} {% set buildKeys = [] %} {% set dates = [] %} -{% for run in projectBuilds %} -{% if run.branch == branch %} -{% if buildKey != run.buildKey %} -{% set buildKey = run.buildKey %} -{% set buildKeys = buildKeys|merge([run.buildKey]) %} -{% set dates = dates|merge([run.timestamp]) %} +{% set logLinks = [] %} +{% 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]) %} +{% set confRunFound = 0 %} +{% for confRun in confRuns if (confRun.getBranchName == branch) and (confRun.getBuildKey == buildKey) %} +{% set logLinks = logLinks|merge([confRun.getLogLink]) %} +{% set confRunFound = 1 %} +{% endfor %} +{% if not confRunFound %} +{% set logLinks = logLinks|merge(['']) %} +{% endif %} {% endif %} {% endif %} {% endfor %} @@ -445,7 +469,12 @@ title="<table> {% else %} {{ buildKey }}<br> {% endif %} -<span class="gray"><small>{{ dates[key]|date("m-d") }}</small></span> +<span class="gray"><small>{{ dates[key]|date("m-d") }}</small></span><br> +{% if logLinks[key] != '' %} +<a href="{{ logLinks[key] }}" target="_blank"><span class="glyphicon glyphicon-file"></span></a> +{% else %} + +{% endif %} </th> {% endfor %} </tr> diff --git a/non-puppet/qtmetrics2/templates/testset.html b/non-puppet/qtmetrics2/templates/testset.html index aa81fbf..c4a0462 100644 --- a/non-puppet/qtmetrics2/templates/testset.html +++ b/non-puppet/qtmetrics2/templates/testset.html @@ -34,8 +34,7 @@ /** * Testset page - * @version 0.8 - * @since 22-07-2015 + * @since 03-08-2015 * @author Juha Sippola */ @@ -220,25 +219,25 @@ and their configuration on <strong>{{ masterProject }} {{ masterState }}</strong {# Get branches #} {% set branches = [] %} -{% for run in projectBuilds %} -{% if run.branch not in branches %} -{% set branches = branches|merge([run.branch]) %} +{% 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 #} +{# Get all build keys, dates and log links #} {% set buildKey = '' %} {% set buildKeys = [] %} {% set dates = [] %} -{% for run in projectBuilds %} -{% if run.branch == branch %} -{% if buildKey != run.buildKey %} -{% set buildKey = run.buildKey %} -{% set buildKeys = buildKeys|merge([run.buildKey]) %} -{% set dates = dates|merge([run.timestamp]) %} +{% 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 %} diff --git a/non-puppet/qtmetrics2/templates/testset_project.html b/non-puppet/qtmetrics2/templates/testset_project.html index 6583738..da12f35 100644 --- a/non-puppet/qtmetrics2/templates/testset_project.html +++ b/non-puppet/qtmetrics2/templates/testset_project.html @@ -34,8 +34,7 @@ /** * Testset project page - * @version 0.3 - * @since 20-07-2015 + * @since 03-08-2015 * @author Juha Sippola */ @@ -85,9 +84,12 @@ testsets in the latest <strong>{{ masterProject }} {{ masterState }}</strong> bu in any configuration across all branches.</li> <li><strong>Results in Branches</strong> shows the results of {{ project }} testsets by branch and their configuration in <strong>{{ masterProject }} {{ masterState }}</strong> builds -( <button type="button" class="btn btn-xs btn-success"><span class="badge">n</span></button> = all n testsets passed, -<button type="button" class="btn btn-xs btn-danger"><span class="badge">n</span></button> = n testsets failed); -details are available as tooltip on result icon.</li> +<ul> +<li>log file: <span class="glyphicon glyphicon-file blue"></span> = link to {{ masterProject }} {{ masterState }} build log file</li> +<li>results: <button type="button" class="btn btn-xs btn-success"><span class="badge">n</span></button> = all n testsets passed, +<button type="button" class="btn btn-xs btn-danger"><span class="badge">n</span></button> = n testsets failed</li> +</ul> +<li>Details are available as tooltip on result icon</li> </ul> </div> </div> @@ -186,25 +188,27 @@ details are available as tooltip on result icon.</li> {# Get branches #} {% set branches = [] %} -{% for run in projectBuilds %} -{% if run.branch not in branches %} -{% set branches = branches|merge([run.branch]) %} +{% 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 #} +{# Get all build keys, dates and log links #} {% set buildKey = '' %} {% set buildKeys = [] %} {% set dates = [] %} -{% for run in projectBuilds %} -{% if run.branch == branch %} -{% if buildKey != run.buildKey %} -{% set buildKey = run.buildKey %} -{% set buildKeys = buildKeys|merge([run.buildKey]) %} -{% set dates = dates|merge([run.timestamp]) %} +{% set logLinks = [] %} +{% 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]) %} +{% set logLinks = logLinks|merge([run.getLogLink]) %} {% endif %} {% endif %} {% endfor %} @@ -234,7 +238,8 @@ details are available as tooltip on result icon.</li> {% else %} {{ buildKey }}<br> {% endif %} -<span class="gray"><small>{{ dates[key]|date("m-d") }}</small></span> +<span class="gray"><small>{{ dates[key]|date("m-d") }}</small></span><br> +<a href="{{ logLinks[key] }}" target="_blank"><span class="glyphicon glyphicon-file"></span></a> </th> {% endfor %} </tr> |