diff options
author | Juha Sippola <juhasippola@outlook.com> | 2015-09-21 16:40:16 +0300 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@theqtcompany.com> | 2015-09-23 09:39:50 +0000 |
commit | 18a1f4f3e92986a0b29577f5c34a4507e690bce3 (patch) | |
tree | 8e7ce89a40f82b60b58ac93b76f748a1d3338014 /non-puppet/qtmetrics2/index.php | |
parent | 5943fba9d274c49e00a6f956536841a99f247e2d (diff) |
Qt Metrics 2 (v0.30): Top test function failures
New page to list top failed testfunctions since a
specific date.
The date scope can be configured in the ini file.
The query duration is about 30 seconds with the
scope of last seven days.
Change-Id: I7b718f8df63efd31a62edff02a15f32e64279efc
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
Diffstat (limited to 'non-puppet/qtmetrics2/index.php')
-rw-r--r-- | non-puppet/qtmetrics2/index.php | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/non-puppet/qtmetrics2/index.php b/non-puppet/qtmetrics2/index.php index fc4e3fb..76465d4 100644 --- a/non-puppet/qtmetrics2/index.php +++ b/non-puppet/qtmetrics2/index.php @@ -34,7 +34,7 @@ /** * Qt Metrics API - * @since 17-09-2015 + * @since 18-09-2015 * @author Juha Sippola */ @@ -72,6 +72,7 @@ $app->get('/', function() use($app) 'platformRoute' => $buildProjectPlatformRoute, 'topRoute' => Slim\Slim::getInstance()->urlFor('top'), 'flakyRoute' => Slim\Slim::getInstance()->urlFor('flaky'), + 'topTestfunctionsRoute' => Slim\Slim::getInstance()->urlFor('toptestfunctions'), 'masterProject' => $ini['master_build_project'], 'masterState' => $ini['master_build_state'], 'branches' => Factory::db()->getBranches(), @@ -437,6 +438,47 @@ $app->get('/data/test/flaky', function() use($app) }); /** + * UI route: /test/toptestfunctions (GET) + */ + +$app->get('/test/toptestfunctions', function() use($app) +{ + $ini = Factory::conf(); + $dbStatus = Factory::db()->getDbRefreshStatus(); + $days = intval($ini['top_failures_last_days']) - 1; + $since = Factory::getSinceDate($days); + $breadcrumb = array( + array('name' => 'home', 'link' => Slim\Slim::getInstance()->urlFor('root')) + ); + $app->render('testfunctions_top.html', array( + 'root' => Slim\Slim::getInstance()->urlFor('root'), + 'dbStatus' => $dbStatus, + 'refreshed' => $dbStatus['refreshed'] . ' (GMT)', + 'breadcrumb' => $breadcrumb, + 'topN' => $ini['top_failures_n'], + 'lastDays' => $ini['top_failures_last_days'], + 'sinceDate' => $since, + 'masterProject' => $ini['master_build_project'], + 'masterState' => $ini['master_build_state'] + )); +})->name('toptestfunctions'); + +$app->get('/data/test/toptestfunctions', function() use($app) +{ + $ini = Factory::conf(); + $days = intval($ini['top_failures_last_days']) - 1; + $since = Factory::getSinceDate($days); + $app->render('testfunctions_top_data.html', array( + 'testsetRoute' => Slim\Slim::getInstance()->urlFor('root') . 'testset', + 'lastDays' => $ini['top_failures_last_days'], + 'sinceDate' => $since, + 'testfunctions' => Factory::createTestfunctions( + $ini['master_build_project'], + $ini['master_build_state']) // managed as objects + )); +}); + +/** * UI route: /testset/:testset/:project (GET) */ |