Adding execution duration to ResultByStatus Report

LATEST Official version.
Questions and discussions - NO ISSUES
FOR ISSUES => http://mantis.testlink.org

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
Xsharp
Advanced user
Posts: 17
Joined: Mon Dec 31, 2012 2:08 pm
Location: Montreal, Canada.

Adding execution duration to ResultByStatus Report

Post by Xsharp »

Hi
since TestLink 1.9.9 it is possible to record the execuction duation with the test result so I tried to change the ResultByStatus.php classe as I can get it shown on failed test cases report but I was'nt able to get it value.
here is the code I added :

in the function buildMatrix of ResultByStatus.php classe I added the line $columns[] = array('title_key' => 'th_execution_duration', 'width' => 35);
after the lines:
$columns[] = array('title_key' => 'th_build', 'width' => 35);
$columns[] = array('title_key' => 'th_run_by', 'width' => 60);
$columns[] = array('title_key' => 'th_date', 'width' => 60);

in the template ResultByStatus.tpl I added "th_execution_duration":
{lang_get var='labels'
s='th_test_suite,test_case,version,th_build,th_run_by,th_bugs_not_linked,
th_date,th_execution_duration,title_execution_notes,th_bugs,summary,generated_by_TestLink_on,
th_assigned_to,th_platform,platform,info_failed_tc_report,
info_blocked_tc_report,info_notrun_tc_report,export_as_spreadsheet'}

in the variable $sql of the classe tlTestPlanMetrics.class.php I added "E.execution_duration AS duration"
$sql = "/* {$debugMsg} executions with status WRITTEN on DB => not run is not present */" .
" SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," .
" TPTCV.tcversion_id,TPTCV.platform_id," .
" E.tcversion_number, E.build_id,E.id AS executions_id, E.status AS status, " .
" E.execution_duration AS duration,E.notes AS execution_notes, E.tester_id,E.execution_ts," .
" TCV.version,TCV.tc_external_id AS external_id, " .
" $fullEID AS full_external_id," .
" (TPTCV.urgency * TCV.importance) AS urg_imp " .
" FROM {$this->tables['testplan_tcversions']} TPTCV " .

in custom_string,txt I added $TLS_th_execution_duration = "Duration";
So I am able to get the title duration but its column contains the execution_note value (all the clumns after duration are shifted to the left).
I know that I'm missing some thing but I can't figure out where. So any help will be really appreciate!
Thanks.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Adding execution duration to ResultByStatus Report

Post by fman »

seems you have configured ONLY new column for TITLE, but you do not have added any code to get and display the value.
You need to read carefully whole code, analysing how any other of the current columns are managed.
Then you will find the missing piece
Xsharp
Advanced user
Posts: 17
Joined: Mon Dec 31, 2012 2:08 pm
Location: Montreal, Canada.

Re: Adding execution duration to ResultByStatus Report

Post by Xsharp »

@Fman,
Thanks for your help. I tried to deep further but no success as I'm not a PHP coder. so if you spot me to the class (or peace of code) witch do the binding of data and the columns that will help me.
Thanks anyway.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Adding execution duration to ResultByStatus Report

Post by fman »

see mantis
6259: Test report matrix - Spreadsheet output - display more info that on HTML output
Post Reply