diff options
Diffstat (limited to 'non-puppet')
-rw-r--r-- | non-puppet/qtmetrics2/index.php | 84 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/scripts/ajax.js | 15 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/src/Database.php | 64 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/src/Factory.php | 11 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/src/test/DatabaseTest.php | 42 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/src/test/FactoryTest.php | 14 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/styles/qtmetrics.css | 5 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/about.html | 4 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/testfunctions_bpass.html | 6 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/testfunctions_bpass_data.html | 107 | ||||
-rw-r--r-- | non-puppet/qtmetrics2/templates/testset.html | 13 |
11 files changed, 295 insertions, 70 deletions
diff --git a/non-puppet/qtmetrics2/index.php b/non-puppet/qtmetrics2/index.php index 9726ec4..98bb7a3 100644 --- a/non-puppet/qtmetrics2/index.php +++ b/non-puppet/qtmetrics2/index.php @@ -34,7 +34,7 @@ /** * Qt Metrics API - * @since 21-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -73,7 +73,7 @@ $app->get('/', function() use($app) 'topRoute' => Slim\Slim::getInstance()->urlFor('top'), 'flakyRoute' => Slim\Slim::getInstance()->urlFor('flaky'), 'topTestfunctionsRoute' => Slim\Slim::getInstance()->urlFor('toptestfunctions'), - 'bpassedTestfunctionsRoute' => Slim\Slim::getInstance()->urlFor('bpassedtestfunctions'), + 'bpassedTestfunctionsRoute' => Slim\Slim::getInstance()->urlFor('bpassed'), 'masterProject' => $ini['master_build_project'], 'masterState' => $ini['master_build_state'], 'branches' => Factory::db()->getBranches(), @@ -439,10 +439,10 @@ $app->get('/data/test/flaky', function() use($app) }); /** - * UI route: /test/toptestfunctions (GET) + * UI route: /test/top/testfunctions (GET) */ -$app->get('/test/toptestfunctions', function() use($app) +$app->get('/test/top/testfunctions', function() use($app) { $ini = Factory::conf(); $dbStatus = Factory::db()->getDbRefreshStatus(); @@ -464,7 +464,7 @@ $app->get('/test/toptestfunctions', function() use($app) )); })->name('toptestfunctions'); -$app->get('/data/test/toptestfunctions', function() use($app) +$app->get('/data/test/top/testfunctions', function() use($app) { $ini = Factory::conf(); $days = intval($ini['top_failures_last_days']) - 1; @@ -475,16 +475,18 @@ $app->get('/data/test/toptestfunctions', function() use($app) 'sinceDate' => $since, 'testfunctions' => Factory::createTestfunctions( Factory::LIST_FAILURES, + '', + '', $ini['master_build_project'], $ini['master_build_state']) // managed as objects )); }); /** - * UI route: /test/bpassedtestfunctions (GET) + * UI route: /test/bpassed (GET) */ -$app->get('/test/bpassedtestfunctions', function() use($app) +$app->get('/test/bpassed', function() use($app) { $ini = Factory::conf(); $dbStatus = Factory::db()->getDbRefreshStatus(); @@ -500,12 +502,70 @@ $app->get('/test/bpassedtestfunctions', function() use($app) 'breadcrumb' => $breadcrumb, 'lastDays' => $ini['blacklisted_pass_last_days'], 'sinceDate' => $since, + 'testset' => '', + 'project' => '', 'masterProject' => $ini['master_build_project'], 'masterState' => $ini['master_build_state'] )); -})->name('bpassedtestfunctions'); +})->name('bpassed'); + +$app->get('/data/test/bpassed', function() use($app) +{ + $ini = Factory::conf(); + $days = intval($ini['blacklisted_pass_last_days']) - 1; + $since = Factory::getSinceDate($days); + $app->render('testfunctions_bpass_data.html', array( + 'testsetRoute' => Slim\Slim::getInstance()->urlFor('root') . 'testset', + 'lastDays' => $ini['blacklisted_pass_last_days'], + 'sinceDate' => $since, + 'testfunctions' => Factory::createTestfunctions( + Factory::LIST_BPASSES, + '', + '', + $ini['master_build_project'], + $ini['master_build_state']) // managed as objects + )); +}); + +/** + * UI route: /test/bpassed/:testset/:project (GET) + */ + +$app->get('/test/bpassed/:testset/:project', function($testset, $project) use($app) +{ + $ini = Factory::conf(); + $dbStatus = Factory::db()->getDbRefreshStatus(); + if (Factory::checkTestset($testset)) { + $days = intval($ini['blacklisted_pass_last_days']) - 1; + $since = Factory::getSinceDate($days); + $testsetRoute = str_replace('/:testset/:project', '', Slim\Slim::getInstance()->urlFor('testset')); + $breadcrumb = array( + array('name' => 'home', 'link' => Slim\Slim::getInstance()->urlFor('root')), + array('name' => $testset, 'link' => $testsetRoute . '/' . $testset . '/' . $project) + ); + $app->render('testfunctions_bpass.html', array( + 'root' => Slim\Slim::getInstance()->urlFor('root'), + 'dbStatus' => $dbStatus, + 'refreshed' => $dbStatus['refreshed'] . ' (GMT)', + 'breadcrumb' => $breadcrumb, + 'lastDays' => $ini['blacklisted_pass_last_days'], + 'sinceDate' => $since, + 'testset' => $testset, + 'project' => $project, + 'masterProject' => $ini['master_build_project'], + 'masterState' => $ini['master_build_state'] + )); + } else { + $app->render('empty.html', array( + 'root' => Slim\Slim::getInstance()->urlFor('root'), + 'dbStatus' => $dbStatus, + 'message' => '404 Not Found' + )); + $app->response()->status(404); + } +})->name('bpassedtestset'); -$app->get('/data/test/bpassedtestfunctions', function() use($app) +$app->get('/data/test/bpassed/:testset/:project', function($testset, $project) use($app) { $ini = Factory::conf(); $days = intval($ini['blacklisted_pass_last_days']) - 1; @@ -514,8 +574,12 @@ $app->get('/data/test/bpassedtestfunctions', function() use($app) 'testsetRoute' => Slim\Slim::getInstance()->urlFor('root') . 'testset', 'lastDays' => $ini['blacklisted_pass_last_days'], 'sinceDate' => $since, + 'testset' => $testset, + 'project' => $project, 'testfunctions' => Factory::createTestfunctions( Factory::LIST_BPASSES, + $testset, + $project, $ini['master_build_project'], $ini['master_build_state']) // managed as objects )); @@ -537,6 +601,7 @@ $app->get('/testset/:testset/:project', function($testset, $project) use($app) ); $testsetTestfunctionsRoute = str_replace('/:testset/:project/:conf', '', Slim\Slim::getInstance()->urlFor('testset_testfunctions')); $testsetProjectRoute = str_replace('/:project', '', Slim\Slim::getInstance()->urlFor('testsetproject')); + $bpassedTestsetRoute = str_replace('/:testset/:project', '', Slim\Slim::getInstance()->urlFor('bpassedtestset')); $app->render('testset.html', array( 'root' => Slim\Slim::getInstance()->urlFor('root'), 'dbStatus' => $dbStatus, @@ -544,6 +609,7 @@ $app->get('/testset/:testset/:project', function($testset, $project) use($app) 'breadcrumb' => $breadcrumb, 'testsetTestfunctionsRoute' => $testsetTestfunctionsRoute, 'testsetProjectRoute' => $testsetProjectRoute, + 'bpassedTestsetRoute' => $bpassedTestsetRoute, 'lastDaysFailures' => $ini['top_failures_last_days'], 'lastDaysFlaky' => $ini['flaky_testsets_last_days'], 'sinceDateFailures' => Factory::getSinceDate(intval($ini['top_failures_last_days']) - 1), diff --git a/non-puppet/qtmetrics2/scripts/ajax.js b/non-puppet/qtmetrics2/scripts/ajax.js index 1f75dfa..7851819 100644 --- a/non-puppet/qtmetrics2/scripts/ajax.js +++ b/non-puppet/qtmetrics2/scripts/ajax.js @@ -34,7 +34,7 @@ /** * Ajax route calls - * @since 21-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -47,6 +47,7 @@ $(function () { // Testset project / latest status var project; + var testset; if ($.inArray('testset_project_data_latest', divs) > -1) { project = $('#project').html(); $.ajax({ @@ -103,7 +104,7 @@ $(function () { // Top testfunction failures if ($.inArray('testfunctions_top_data', divs) > -1) { $.ajax({ - url: "data/test/toptestfunctions", + url: "data/test/top/testfunctions", dataType: "html", cache: true }) @@ -115,8 +116,16 @@ $(function () { // Blacklisted passed testfunctions if ($.inArray('testfunctions_blacklisted_passed_data', divs) > -1) { + testset = $('#testset').html(); + project = $('#project').html(); + var url; + if (testset === '') { + url = "data/test/bpassed"; + } else { + url = "data/test/bpassed/" + testset + "/" + project; + } $.ajax({ - url: "data/test/bpassedtestfunctions", + url: url, dataType: "html", cache: true }) diff --git a/non-puppet/qtmetrics2/src/Database.php b/non-puppet/qtmetrics2/src/Database.php index bc4fea6..33b77b8 100644 --- a/non-puppet/qtmetrics2/src/Database.php +++ b/non-puppet/qtmetrics2/src/Database.php @@ -34,7 +34,7 @@ /** * Database class - * @since 21-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -871,6 +871,68 @@ class Database { } /** + * Get counts of blacklisted passed testfunctions for a testset in specified builds since specified date + * Only the testfunctions that are blacklisted, are only passed and have been run since the specified date are listed + * @param string $testset + * @param string $project + * @param string $runProject + * @param string $runState + * @param string $date + * @return array (string name, string testset, string project, string conf, int bpassed, int btotal) + */ + public function getTestfunctionsBlacklistedPassedCountsTestset($testset, $project, $runProject, $runState, $date) + { + $result = array(); + $query = $this->db->prepare(" + SELECT + testfunction.name AS testfunction, + testset.name AS testset, + project.name AS project, + conf.name AS conf, + COUNT(CASE WHEN testfunction_run.result IN ('bpass', 'bxfail') THEN testfunction_run.result END) AS bpassed, + COUNT(CASE WHEN testfunction_run.result LIKE '%' THEN testfunction_run.result END) AS btotal + FROM testfunction_run + INNER JOIN testfunction ON testfunction_run.testfunction_id = testfunction.id + INNER JOIN testset_run ON testfunction_run.testset_run_id = testset_run.id + INNER JOIN testset ON testset_run.testset_id = testset.id + INNER JOIN project ON testset.project_id = project.id + INNER JOIN conf_run ON testset_run.conf_run_id = conf_run.id + INNER JOIN conf ON conf_run.conf_id = conf.id + INNER JOIN project_run ON conf_run.project_run_id = project_run.id + INNER JOIN branch ON project_run.branch_id = branch.id + INNER JOIN state ON project_run.state_id = state.id + WHERE + project_run.project_id = (SELECT id FROM project WHERE name = ?) AND + project_run.state_id = (SELECT id FROM state WHERE name = ?) AND + testset.name = ? AND + project.name = ? AND + project_run.timestamp >= ? AND + branch.archived = 0 + GROUP BY testfunction.name, testset.name, project.name, conf.name + ORDER BY project.name, testset.name, testfunction.name, conf.name; + "); + $query->bindParam(1, $runProject); + $query->bindParam(2, $runState); + $query->bindParam(3, $testset); + $query->bindParam(4, $project); + $query->bindParam(5, $date); + $query->execute(); + while($row = $query->fetch(PDO::FETCH_ASSOC)) { + if ($row['bpassed'] === $row['btotal']) { // return only those where only bpasses + $result[] = array( + 'name' => $row['testfunction'], + 'testset' => $row['testset'], + 'project' => $row['project'], + 'conf' => $row['conf'], + 'bpassed' => $row['bpassed'], + 'btotal' => $row['btotal'] + ); + } + } + return $result; + } + + /** * Get project run data by branch * @param string $runProject * @param string $runState diff --git a/non-puppet/qtmetrics2/src/Factory.php b/non-puppet/qtmetrics2/src/Factory.php index bb4e7c5..7867154 100644 --- a/non-puppet/qtmetrics2/src/Factory.php +++ b/non-puppet/qtmetrics2/src/Factory.php @@ -34,7 +34,7 @@ /** * Factory class - * @since 21-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -284,11 +284,13 @@ class Factory { * Create Testfunction objects for those in database (with either failed or bpassed counts) * List is limited by date (since) and length, and for specified builds only * @param int $listType + * @param string $testset + * @param string $project * @param string $runProject * @param string $runState * @return array Testfunction objects */ - public static function createTestfunctions($listType, $runProject, $runState) + public static function createTestfunctions($listType, $testset, $project, $runProject, $runState) { $objects = array(); $ini = self::conf(); @@ -308,7 +310,10 @@ class Factory { if ($listType === self::LIST_BPASSES) { $days = intval($ini['blacklisted_pass_last_days']) - 1; $since = self::getSinceDate($days); - $dbEntries = self::db()->getTestfunctionsBlacklistedPassedCounts($runProject, $runState, $since); + if ($testset === '') + $dbEntries = self::db()->getTestfunctionsBlacklistedPassedCounts($runProject, $runState, $since); + else + $dbEntries = self::db()->getTestfunctionsBlacklistedPassedCountsTestset($testset, $project, $runProject, $runState, $since); foreach($dbEntries as $entry) { $obj = new Testfunction($entry['name'], $entry['testset'], $entry['project'], $entry['conf']); $obj->setBlacklistedCounts($entry['bpassed'], $entry['btotal']); diff --git a/non-puppet/qtmetrics2/src/test/DatabaseTest.php b/non-puppet/qtmetrics2/src/test/DatabaseTest.php index 74e5cfa..d5e4ad5 100644 --- a/non-puppet/qtmetrics2/src/test/DatabaseTest.php +++ b/non-puppet/qtmetrics2/src/test/DatabaseTest.php @@ -38,7 +38,7 @@ require_once(__DIR__.'/../Factory.php'); * Database unit test class * Some of the tests require the test data as inserted into database with qtmetrics_insert.sql * @example To run (in qtmetrics root directory): php <path-to-phpunit>/phpunit.phar ./src/test - * @since 21-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -678,6 +678,46 @@ class DatabaseTest extends PHPUnit_Framework_TestCase } /** + * Test getTestfunctionsBlacklistedPassedCountsTestset + * @dataProvider testGetTestfunctionsBlacklistedPassedCountsTestsetData + */ + public function testGetTestfunctionsBlacklistedPassedCountsTestset($testset, $project, $runProject, $runState, $date, $exp_testfunction, $exp_excluded_testfunction, $exp_testfunction_count_min, $exp_bpassed_min) + { + $testfunctions = array(); + $bpassed = 0; + $db = Factory::db(); + $result = $db->getTestfunctionsBlacklistedPassedCountsTestset($testset, $project, $runProject, $runState, $date); + foreach($result as $row) { + $this->assertArrayHasKey('name', $row); + $this->assertArrayHasKey('testset', $row); + $this->assertArrayHasKey('project', $row); + $this->assertArrayHasKey('conf', $row); + $this->assertArrayHasKey('bpassed', $row); + $this->assertArrayHasKey('btotal', $row); + $this->assertEquals($row['btotal'], $row['bpassed']); + $testfunctions[] = $row['name']; + $bpassed += $row['bpassed']; + } + $this->assertGreaterThanOrEqual($exp_testfunction_count_min, count($testfunctions)); + if ($exp_testfunction_count_min > 0) { + $this->assertNotEmpty($result); + $this->assertContains($exp_testfunction, $testfunctions); + $this->assertNotContains($exp_excluded_testfunction, $testfunctions); + $this->assertGreaterThanOrEqual($exp_bpassed_min, $bpassed); + } + } + public function testGetTestfunctionsBlacklistedPassedCountsTestsetData() + { + return array( + array('tst_qfont', 'qtbase', 'Qt5', 'state', '2013-05-01', 'lastResortFont', 'resetFont', 1, 1), // in test data lastResortFont has bpassed and resetFont doesn't + array('tst_qfont', 'qtbase', 'Qt5', 'state', '2013-05-01', 'lastResortFont', 'styleName', 1, 1), // in test data lastResortFont has bpassed and styleName has bskipped as well + array('tst_qftp', 'qtbase', 'Qt5', 'state', '2013-05-01', 'lastResortFont', 'styleName', 0, 0), + array('tst_qfont', 'qtbase', 'Qt5', 'state', '2013-05-29', '', '', 0, 0), + array('tst_qfont', 'qtbase', 'Qt5', 'state', '2999-05-29', '', '', 0, 0) + ); + } + + /** * Test getProjectBuildsByBranch * @dataProvider testGetProjectBuildsByBranchData */ diff --git a/non-puppet/qtmetrics2/src/test/FactoryTest.php b/non-puppet/qtmetrics2/src/test/FactoryTest.php index 78408a5..96530f7 100644 --- a/non-puppet/qtmetrics2/src/test/FactoryTest.php +++ b/non-puppet/qtmetrics2/src/test/FactoryTest.php @@ -37,7 +37,7 @@ require_once(__DIR__.'/../Factory.php'); /** * Factory unit test class * @example To run (in qtmetrics root directory): php <path-to-phpunit>/phpunit.phar ./src/test - * @since 21-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -285,9 +285,9 @@ class FactoryTest extends PHPUnit_Framework_TestCase * Test createTestfunctions * @dataProvider testCreateTestfunctionsData */ - public function testCreateTestfunctions($listType, $runProject, $runState) + public function testCreateTestfunctions($listType, $testset, $project, $runProject, $runState) { - $testfunctions = Factory::createTestfunctions($listType, $runProject, $runState); + $testfunctions = Factory::createTestfunctions($listType, $testset, $project, $runProject, $runState); foreach($testfunctions as $testfunction) { $this->assertTrue($testfunction instanceof Testfunction); $result = $testfunction->getResultCounts(); @@ -304,8 +304,12 @@ class FactoryTest extends PHPUnit_Framework_TestCase public function testCreateTestfunctionsData() { return array( - array(Factory::LIST_FAILURES, 'Qt5', 'state'), - array(Factory::LIST_BPASSES, 'Qt5', 'state') + array(Factory::LIST_FAILURES, 'tst_qfont', 'qtbase', 'Qt5', 'state'), + array(Factory::LIST_FAILURES, 'tst_qftp', 'qtbase', 'Qt5', 'state'), + array(Factory::LIST_FAILURES, '', '', 'Qt5', 'state'), + array(Factory::LIST_BPASSES, 'tst_qfont', 'qtbase', 'Qt5', 'state'), + array(Factory::LIST_BPASSES, 'tst_qftp', 'qtbase', 'Qt5', 'state'), + array(Factory::LIST_BPASSES, '', '', 'Qt5', 'state') ); } diff --git a/non-puppet/qtmetrics2/styles/qtmetrics.css b/non-puppet/qtmetrics2/styles/qtmetrics.css index fa2c3c8..2154532 100644 --- a/non-puppet/qtmetrics2/styles/qtmetrics.css +++ b/non-puppet/qtmetrics2/styles/qtmetrics.css @@ -35,7 +35,7 @@ /** * Qt Metrics style sheet - * @since 20-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -205,3 +205,6 @@ thead { .bold { font-weight: bold; } +.hidden { + visibility: hidden; +} diff --git a/non-puppet/qtmetrics2/templates/about.html b/non-puppet/qtmetrics2/templates/about.html index 40a3fcc..d1d72d5 100644 --- a/non-puppet/qtmetrics2/templates/about.html +++ b/non-puppet/qtmetrics2/templates/about.html @@ -34,7 +34,7 @@ /** * About window content - * @since 21-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -52,4 +52,4 @@ and the global Qt developer community are the target audience. For detailed desc <p>See the <strong><a href="https://wiki.qt.io/Qt_Metrics_2_Backlog" target="_blank">backlog</a></strong> for development items currently identified or in progress.</p> -<p><small>Version 0.32 (21-Sep-2015)</small></p> +<p><small>Version 0.33 (22-Sep-2015)</small></p> diff --git a/non-puppet/qtmetrics2/templates/testfunctions_bpass.html b/non-puppet/qtmetrics2/templates/testfunctions_bpass.html index 1dc5394..91ed345 100644 --- a/non-puppet/qtmetrics2/templates/testfunctions_bpass.html +++ b/non-puppet/qtmetrics2/templates/testfunctions_bpass.html @@ -34,7 +34,7 @@ /** * Blacklisted passes (testfunctions) page - * @since 21-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -57,6 +57,8 @@ {##### Title #####} <h1 class="page-header"> +<span id="testset">{{ testset }}</span> +<span id="project" class="hidden">{{ project }}</span> Test Function Blacklisted Passes <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> @@ -94,9 +96,11 @@ and configuration. The testset link opens a page where the test functions are li <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"> </div> </div> +{% if testset == '' %} <div class="alert alert-warning" role="alert"> <span class="glyphicon glyphicon-time"></span> <strong>Please wait:</strong> Extracting the data will be ready in less than a minute! </div> +{% endif %} </div> {# testfunctions_blacklisted_passed_data #} </div> {# .col... #} diff --git a/non-puppet/qtmetrics2/templates/testfunctions_bpass_data.html b/non-puppet/qtmetrics2/templates/testfunctions_bpass_data.html index 117db0d..7fd55d7 100644 --- a/non-puppet/qtmetrics2/templates/testfunctions_bpass_data.html +++ b/non-puppet/qtmetrics2/templates/testfunctions_bpass_data.html @@ -34,7 +34,7 @@ /** * Blacklisted passes (testfunctions) data - * @since 21-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -49,8 +49,31 @@ */ #} +{# Calculate max result count for the bar #} +{% set prevTestsetName = '' %} +{% set prevProjectName = '' %} +{% set testfunctionCount = 0 %} +{% set maxCount = 1 %} +{% for testfunction in testfunctions %} +{% if (testfunction.getTestsetName == prevTestsetName) and (testfunction.getTestsetProjectName == prevProjectName) %} +{% set testfunctionCount = testfunctionCount + 1 %} +{% else %} +{% if testfunctionCount > maxCount %} +{% set maxCount = testfunctionCount %} +{% endif %} +{% set testfunctionCount = 1 %} +{% endif %} +{% set prevTestsetName = testfunction.getTestsetName %} +{% set prevProjectName = testfunction.getTestsetProjectName %} +{% endfor %} +{% if testfunctionCount > maxCount %} +{% set maxCount = testfunctionCount %} +{% endif %} + {##### Summary #####} +{% if testfunctionCount > 0 %} + <div class="panel panel-primary"> <div class="panel-heading"> <h4 class="panel-title bold">Summary <small>(last {{ lastDays }} days since {{ sinceDate }})</small></h4> @@ -67,48 +90,31 @@ </tr> </thead> <tbody> -{# Calculate max result count for the bar #} -{% set prevTestsetName = '' %} -{% set prevProjectName = '' %} -{% set testfunctionCount = 0 %} -{% set maxCount = 1 %} -{% for testfunction in testfunctions %} -{% if (testfunction.getTestsetName == prevTestsetName) and (testfunction.getTestsetProjectName == prevProjectName) %} -{% set testfunctionCount = testfunctionCount + 1 %} -{% else %} -{% if testfunctionCount > maxCount %} -{% set maxCount = testfunctionCount %} -{% endif %} -{% set testfunctionCount = 1 %} -{% endif %} -{% set prevTestsetName = testfunction.getTestsetName %} -{% set prevProjectName = testfunction.getTestsetProjectName %} -{% endfor %} {# Print testsets #} -{% set prevTestsetName = '' %} -{% set prevProjectName = '' %} -{% set testfunctionCount = 0 %} -{% set bar = 0 %} -{% for testfunction in testfunctions %} +{% set prevTestsetName = '' %} +{% set prevProjectName = '' %} +{% set testfunctionCount = 0 %} +{% set bar = 0 %} +{% for testfunction in testfunctions %} {# First row #} -{% if prevTestsetName == '' %} +{% if prevTestsetName == '' %} <tr> <td>{{ testfunction.getTestsetName }}</td> <td>{{ testfunction.getTestsetProjectName }}</td> -{% set testfunctionCount = 1 %} +{% set testfunctionCount = 1 %} {# Same testset: Increase the counter #} -{% elseif (testfunction.getTestsetName == prevTestsetName) and (testfunction.getTestsetProjectName == prevProjectName) %} -{% set testfunctionCount = testfunctionCount + 1 %} +{% elseif (testfunction.getTestsetName == prevTestsetName) and (testfunction.getTestsetProjectName == prevProjectName) %} +{% set testfunctionCount = testfunctionCount + 1 %} {# New testset: Print count for previous one and start new row #} -{% else %} -{% set bar = ((BAR_AREA/maxCount) * testfunctionCount)|round(0, 'floor') %} -{% if (testfunctionCount > 0) and (bar == 0) %} -{% set bar = 1 %} -{% endif %} +{% else %} +{% set bar = ((BAR_AREA/maxCount) * testfunctionCount)|round(0, 'floor') %} +{% if (testfunctionCount > 0) and (bar == 0) %} +{% set bar = 1 %} +{% endif %} <td class="leftBorder center">{{ testfunctionCount }}</td> <td class="center showInLargeDisplay"> <div> @@ -119,18 +125,18 @@ <tr> <td>{{ testfunction.getTestsetName }}</td> <td>{{ testfunction.getTestsetProjectName }}</td> -{% set testfunctionCount = 1 %} -{% endif %} -{% set prevTestsetName = testfunction.getTestsetName %} -{% set prevProjectName = testfunction.getTestsetProjectName %} -{% endfor %}{# testfunction #} +{% set testfunctionCount = 1 %} +{% endif %} +{% set prevTestsetName = testfunction.getTestsetName %} +{% set prevProjectName = testfunction.getTestsetProjectName %} +{% endfor %}{# testfunction #} {# Print count for last one #} -{% if testfunctionCount > 0 %} -{% set bar = ((BAR_AREA/maxCount) * testfunctionCount)|round(0, 'floor') %} -{% if (testfunctionCount > 0) and (bar == 0) %} -{% set bar = 1 %} -{% endif %} +{% if testfunctionCount > 0 %} +{% set bar = ((BAR_AREA/maxCount) * testfunctionCount)|round(0, 'floor') %} +{% if (testfunctionCount > 0) and (bar == 0) %} +{% set bar = 1 %} +{% endif %} <td class="leftBorder center">{{ testfunctionCount }}</td> <td class="center showInLargeDisplay"> <div> @@ -139,19 +145,24 @@ </td> </tr> -{% endif %} +{% endif %} </tbody> </table> </div> {# .table-responsive #} </div> {# .panel-body #} </div> {# .panel... #} +{% endif %}{# testfunctionCount #} + {##### List #####} <div class="panel panel-primary"> <div class="panel-heading"> <h4 class="panel-title bold">Blacklisted Passes <small>(last {{ lastDays }} days since {{ sinceDate }})</small></h4> </div> + +{% if testfunctionCount > 0 %} + <div class="panel-body"> <div class="table-responsive"> <table class="table table-striped"> @@ -191,4 +202,14 @@ </table> </div> {# .table-responsive #} </div> {# .panel-body #} + +{% endif %}{# testfunctionCount #} + </div> {# .panel... #} + +{% if testfunctionCount == 0 %} +<div class="alert alert-info" role="alert"> +The testset {{ testset }} ({{ project }}) either does not have any blacklisted test functions, +or there are failed or skipped blacklisted test functions since {{ sinceDate }}! +</div> +{% endif %}{# testfunctionCount #} diff --git a/non-puppet/qtmetrics2/templates/testset.html b/non-puppet/qtmetrics2/templates/testset.html index b5b86d6..817e783 100644 --- a/non-puppet/qtmetrics2/templates/testset.html +++ b/non-puppet/qtmetrics2/templates/testset.html @@ -34,7 +34,7 @@ /** * Testset page (list of configurations) - * @since 17-09-2015 + * @since 22-09-2015 * @author Juha Sippola */ @@ -91,6 +91,7 @@ <div class="well infoWell"> <span class="glyphicon glyphicon-info-sign"></span> <strong>Testset</strong><br> <ul> +<li><strong>Buttons</strong> open a detailed list for the {{ testset.getName }} testset</li> <li><strong>Latest Status</strong> shows the overall testset status across all branches <ul> <li>latest result: overall testset status based on the latest @@ -118,6 +119,16 @@ and their configuration on <strong>{{ masterProject }} {{ masterState }}</strong </div> </div> +{##### Buttons #####} + +<div> +<div class="btn-group"> +{% set link = bpassedTestsetRoute ~ '/' ~ testset.getName|url_encode ~ '/' ~ testset.getProjectName|url_encode %} +<a class="btn btn-primary btn-xs" href="{{ link }}" role="button">test function blacklisted passes</a> +</div> +</div> +<hr> + {% if runsAvailable %} {##### Latest Status #####} |