Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002525TestLinkCustom fieldspublic2009-05-21 04:422011-01-22 15:11
Reporteraostad 
Assigned Tofman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.8.2 
Fixed in Version1.9.1 (bug fixing) 
Summary0002525: No "CF_ESTIMATED_EXEC_TIME" in test report
DescriptionI defined and assigned "CF_ESTIMATED_EXEC_TIME" but it doesnot show up in test report. However, CF_EXEC_TIME shows up.
TagsNo tags attached.
Database (MySQL,Postgres,etc)
Browser
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Filesxml file icon customFields_TimeMeas.xml [^] (1,653 bytes) 2010-10-25 07:36
jpg file icon No_estimated_time.jpg [^] (190,577 bytes) 2010-10-25 10:44


rar file icon Solution_issue_2525.rar [^] (35,756 bytes) 2011-01-11 12:57

- Relationships
related to 0002343closedfman CF_ESTIMATED_EXEC_TIME does not get displaid 

-  Notes
(0006987)
mhavlat (reporter)
2009-05-21 09:47

I can confirm the bug:
printDocument.php:

                $timeEstimatedDuration = $tplan_mgr->get_estimated_execution_time($args->tplan_id,$tcase_filter);

This function get 0. Report logic disables the text for value 0.
(0011966)
Furlan (reporter)
2010-10-19 09:15

I have the same problem with TestLink 1.9 (RC 1 - QA - 20100927).

in lib/functions/testplan.class.php the keys saved in the table cfield_design_values are wrong (-1 respect to the correct Testcase ID):

// we will compute time for ALL linked test cases
// $linked_testcases=$this->get_linked_tcversions($id);
// Test done due to BUGID 3434 has shown that:
// get_linked_items_id($id) has better performance than get_linked_tcversions($id);
$linked_testcases=$this->get_linked_items_id($id);
// BUG: the list delieved is wrong: the actual keys are -1 (e.g. tcase_id=1504) of those saved in the table cfield_design_values (e.g. node_id=1505)
if( ($status_ok=!is_null($linked_testcases)) )
{
    $tcase_ids=array_keys($linked_testcases);
}
(0012056)
fman (administrator)
2010-10-23 16:01

Please give detailed steps to reproduce.
(0012061)
Furlan (reporter)
2010-10-25 08:10

1) Import Time Measurement Custom Fields as in attach (I created them manually and not over the sql-script, but they _should_ be identical).

2) activate the custom fields for a test project

3) in the test specification mask insert an estimated time value to at least one testcase in a suite.

4) search in the mySQL DB which values are listed in the table "cfield_design_values" which is used in testplan.class.php to get the tcase_id(s) == node_id(s):

$sql="SELECT SUM(CAST(value AS NUMERIC)) ";
if( DB_TYPE == 'mysql')
    {
    $sql="SELECT SUM(value) ";
    }
    else if ( DB_TYPE == 'postgres')
    {
    $sql="SELECT SUM(CAST(value AS NUMERIC)) ";
    }
    $sql .= " AS SUM_VALUE FROM {$this->tables['cfield_design_values']} CFDV " .
    " WHERE CFDV.field_id={$cfield_id} " .
    " AND node_id IN (" . implode(',',$tcase_ids) . ")";
    $estimated=$this->db->fetchOneValue($sql);
    $estimated=is_null($estimated) ? 0 :$estimated;


5) call the function get_linked_items_id($id) where $id= <node_id of the testsuite containing the testcases>

6) the array which is delivered by this function is offset of 1 value respect to the one returned by the $sql clause.

That's way the estimate value sum always 0 and is not displayed in the Test Report also with the Metrics selected.

Thanks for your help!

Andrea
(0012063)
fman (administrator)
2010-10-25 10:21

Thanks for help, but ...
I need steps to reproduce done at User Interface level => what a user get.
The queries can help but are not part of description of problem, and sometimes are misleading
(0012064)
Furlan (reporter)
2010-10-25 10:40

OK.
Step 1-3 are as above.

4) click on Test Report, select all check boxes (or at least "metrics"), select the Test Suite containing the Testcases with a non-zero Estimate Time Custom Field.
The result is in attach (I patched my local installation of TL commenting out the if-clause which just prints the string if the value is greater than 0).

Thanks
(0012068)
fman (administrator)
2010-10-25 13:49

Thanks for info.
(0013243)
KathrinMarkus (reporter)
2011-01-11 12:58

Wrong estimate Time (Issue 002525) - solution

Postby Markus ยป Tue Jan 11, 2011 11:39 am
Hello,
I have solved the Issue mentioned below locally and perhaps you can reuse my solution. for problem description see the issue.

change in file \lib\results\printDocument.php on line 231 part testsuite
case 'testsuite':
foreach ($platforms as $platform_id => $platform_name)
....
$filters = array( 'tsuites_id' => $branch_tsuites,'platform_id' => $platform_id);
$tp_tcs = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters);
!!!NEW $getOpt = array('output' => 'tcversion', 'addIfNull' => true);
!!!NEW $tp_tcs_cal = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters,$getOpt);
$tcase_filter=!is_null($tp_tcs) ? array_keys((array)$tp_tcs): null;
!!!NEW $tcase_filter_cal=!is_null($tp_tcs_cal) ? array_keys((array)$tp_tcs_cal): null;
...

change in file \lib\functions\testplan.class.php on line 968 part:
switch($my['options']['output'])
{
...
case 'mapOfMapExecPlatform':
// with this option we got just one record for each (platform, build)

$recordset = $this->db->fetchMapRowsIntoMap($sql,'exec_id','platform_id');
break;

!!!NEW case 'tcversion':
!!!NEW $recordset = $this->db->fetchRowsIntoMap($sql,'tcversion_id');
!!!NEW break;

After that the estimated time is now calculated correct. (see attachment)
(0013245)
fman (administrator)
2011-01-11 17:49

Please
attach FULL PHP FILE not only changed lines
(0013247)
KathrinMarkus (reporter)
2011-01-12 05:27

Please check attachments
(0013265)
fman (administrator)
2011-01-12 18:51

Regarding note (0011966)
From 1.9 RC1 and up CUSTOM FIELDS values for test cases AT DESIGN TIME are managed AT test case version level and not ANYMORE at Test case level.
(0013352)
fman (administrator)
2011-01-22 15:11

1.9.1 Released

- Issue History
Date Modified Username Field Change
2009-05-21 04:42 aostad New Issue
2009-05-21 09:47 mhavlat Note Added: 0006987
2009-05-21 09:55 mhavlat Relationship added related to 0002343
2010-10-19 09:15 Furlan Note Added: 0011966
2010-10-19 18:15 fman Assigned To => fman
2010-10-19 18:15 fman Status new => assigned
2010-10-23 16:01 fman Note Added: 0012056
2010-10-25 07:36 Furlan File Added: customFields_TimeMeas.xml
2010-10-25 08:10 Furlan Note Added: 0012061
2010-10-25 10:21 fman Note Added: 0012063
2010-10-25 10:40 Furlan Note Added: 0012064
2010-10-25 10:44 Furlan File Added: No_estimated_time.jpg
2010-10-25 13:49 fman Note Added: 0012068
2011-01-11 12:57 KathrinMarkus File Added: Solution_issue_2525.rar
2011-01-11 12:58 KathrinMarkus Note Added: 0013243
2011-01-11 17:49 fman Note Added: 0013245
2011-01-12 05:27 KathrinMarkus Note Added: 0013247
2011-01-12 18:51 fman Note Added: 0013265
2011-01-18 18:44 fman Status assigned => resolved
2011-01-18 18:44 fman Fixed in Version => 1.9.1 (bug fixing)
2011-01-18 18:44 fman Resolution open => fixed
2011-01-22 15:11 fman Note Added: 0013352
2011-01-22 15:11 fman Status resolved => closed



Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker