Skip to content
Permalink
Browse files

TICKET 7329: Report - Test Results Flat - Test Case Version indicatio…

…n is not present

TICKET 7330: Report - Test Results Flat - Add Test Case Version execution type indication
  • Loading branch information
fmancardi committed Nov 6, 2015
1 parent f1da8d9 commit 272e0cdcc0536927c84b1aa6897f53cfa72c9773
Showing with 34 additions and 8 deletions.
  1. +8 −3 lib/functions/tlTestPlanMetrics.class.php
  2. +26 −5 lib/results/resultsTCFlat.php
@@ -1870,7 +1870,7 @@ function helperBuildSQLTestSuiteExecCounters($id, $filters=null, $opt=null)


// Additional Execution fields
$moreExecFields = '';
$moreExecFields = "";
if($my['opt']['getExecutionNotes'])
{
$moreExecFields .= "E.notes AS execution_notes,";
@@ -1903,7 +1903,10 @@ function helperBuildSQLTestSuiteExecCounters($id, $filters=null, $opt=null)
" SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," .
" TPTCV.tcversion_id,TPTCV.platform_id," .
" E.build_id,E.tcversion_number AS version,TCV.tc_external_id AS external_id, " .
" E.id AS executions_id, E.status AS status, " . $moreExecFields .
" E.id AS executions_id, E.status AS status, " .
$moreExecFields .
" E.execution_type AS exec_type," .

" (TPTCV.urgency * TCV.importance) AS urg_imp " .
" FROM {$this->tables['testplan_tcversions']} TPTCV " .

@@ -1948,7 +1951,9 @@ function helperBuildSQLTestSuiteExecCounters($id, $filters=null, $opt=null)
" TPTCV.tcversion_id, TPTCV.platform_id," .
" BU.id AS build_id,TCV.version,TCV.tc_external_id AS external_id, " .
" COALESCE(E.id,-1) AS executions_id, " .
" COALESCE(E.status,'{$this->notRunStatusCode}') AS status, " . $moreExecFields .
" COALESCE(E.status,'{$this->notRunStatusCode}') AS status, " .
$moreExecFields .
" TCV.execution_type AS exec_type," .
" (TPTCV.urgency * TCV.importance) AS urg_imp " .
" FROM {$this->tables['testplan_tcversions']} TPTCV " .

@@ -9,7 +9,7 @@
*
*
* @internal revisions
* @since 1.9.14
* @since 1.9.15
*/
require('../../config.inc.php');
require_once('../../third_party/codeplex/PHPExcel.php'); // Must be included BEFORE common.php
@@ -54,12 +54,13 @@

$execStatus = $metricsMgr->getExecStatusMatrixFlat($args->tplan_id,$buildSet,$opt);


$metrics = $execStatus['metrics'];
$latestExecution = $execStatus['latestExec'];

// Every Test suite a row on matrix to display will be created
// One matrix will be created for every platform that has testcases
$tcols = array('tsuite', 'tcase');
$tcols = array('tsuite', 'tcase','version');
if($gui->show_platforms)
{
$tcols[] = 'platform';
@@ -243,7 +244,9 @@ function initializeGui(&$dbHandler,&$argsObj,$imgSet,&$tplanMgr)

$l18n = init_labels(array('design' => null, 'execution' => null, 'history' => 'execution_history',
'test_result_flat_filters' => null, 'too_much_data' => null,'too_much_builds' => null,
'result_on_last_build' => null, 'versionTag' => 'tcversion_indicator') );
'result_on_last_build' => null, 'versionTag' => 'tcversion_indicator',
'execution_type_manual' => null,
'execution_type_auto' => null) );

$l18n['not_run']=lang_get($cfg['results']['status_label']['not_run']);

@@ -292,7 +295,8 @@ function createSpreadsheet($gui,$args)
'notes' => null, 'date_time_run' => null, 'execution_duration' => null,
'testproject' => null,'generated_by_TestLink_on' => null,'testplan' => null,
'result_on_last_build' => null,'last_execution' => null,
'assigned_to' => null,'tcexec_result' => null));
'assigned_to' => null,'tcexec_result' => null,
'version' => null,'execution_type' => null));

$buildIDSet = $args->builds->idSet;

@@ -336,6 +340,7 @@ function createSpreadsheet($gui,$args)
// data is organized with following columns $dataHeader[]
// Test suite
// Test case
// Test case version (for humans)
// [Platform] => if any exists
//
// Priority ===> Just discovered that we have choosen to make this column
@@ -354,7 +359,9 @@ function createSpreadsheet($gui,$args)
// ?? Exec result on ON LATEST CREATED Build
// ?? Latest Execution result (Hmm need to explain better)
//
$dataHeader = array($lbl['title_test_suite_name'],$lbl['title_test_case_title']);
$dataHeader = array($lbl['title_test_suite_name'],
$lbl['title_test_case_title'],
$lbl['version']);

if( $showPlatforms = !is_null($gui->platforms) )
{
@@ -374,6 +381,7 @@ function createSpreadsheet($gui,$args)
$dataHeader[] = $lbl['test_exec_by'];
$dataHeader[] = $lbl['notes'];
$dataHeader[] = $lbl['execution_duration'];
$dataHeader[] = $lbl['execution_type'];

$startingRow = count($lines2write) + 2; // MAGIC
$cellArea = "A{$startingRow}:";
@@ -465,6 +473,11 @@ function buildSpreadsheetData(&$db,&$args,&$gui,&$exec,$labels)
$userSet = getUsersForHtmlOptions($db,null,null,null,null,
array('userDisplayFormat' => '%first% %last%'));

$det = array(TESTCASE_EXECUTION_TYPE_MANUAL =>
$labels['execution_type_manual'],
TESTCASE_EXECUTION_TYPE_AUTO =>
$labels['execution_type_auto']);

$metrics = $exec['metrics'];
$latestExecution = $exec['latestExec'];
$cols = $args->cols;
@@ -485,6 +498,7 @@ function buildSpreadsheetData(&$db,&$args,&$gui,&$exec,$labels)
execution_duration NULL
user_id 1 => NEED TO DECODE
urg_imp 4 => NEED TO DECODE
execution_type => NEED TO DECODE
*/

$loop2do = count($metrics);
@@ -500,6 +514,8 @@ function buildSpreadsheetData(&$db,&$args,&$gui,&$exec,$labels)
$rows[$cols['tcase']] =
htmlspecialchars("{$eid}:{$metrics[$ix]['name']}",ENT_QUOTES);

$rows[$cols['version']] = $metrics[$ix]['version'];

if ($gui->show_platforms)
{
$rows[$cols['platform']] = $gui->platforms[$metrics[$ix]['platform_id']];
@@ -533,6 +549,11 @@ function buildSpreadsheetData(&$db,&$args,&$gui,&$exec,$labels)

$rows[] = $metrics[$ix]['execution_notes'];
$rows[] = $metrics[$ix]['execution_duration'];

$rows[] =
isset($det[$metrics[$ix]['exec_type']]) ?
$det[$metrics[$ix]['exec_type']] : 'not configured';

$gui->matrix[] = $rows;
}
}

0 comments on commit 272e0cd

Please sign in to comment.
You can’t perform that action at this time.