Mantis Bugtracker 

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004819TestLinkFilterspublic2011-11-24 00:082012-09-01 19:59
Assigned Tofman 
PlatformTestLink 1.9.3OSLinuxOS VersionSLES 10.3
Product Version1.9.3 (2011 Q3 - bug fixing) 
Fixed in Version1.9.4 (2012 Q3 - bug fixing) 
Summary0004819: Filtering execution by "Not Run" on "ALL Builds" shows too few results
DescriptionWhen filtering for test execution, we find it most useful to view all not-run testcases on all builds; i.e., what testcases are left to run that have not been run on any build.

With 1.9.3, it appears that this is not working due to it not taking platforms into account.
Steps To ReproduceHave multiple platforms with the same testcases set to be run on multiple platforms.

Run a testcase on one platform.

Filter results on the other platform, choosing "Not Run" on "ALL Builds."
Additional InformationI believe I fixed it ... it looks like the fix was already in the code in a variable, but the variable was not used in the SQL string for this particular function. The function is get_same_status_for_build_set in testplan.class.php.

The code in question below was missing the $executionPlatformString and $tcversionPlatformString variables ... which meant it counted as testcases run for platform X if they were run on ANY platform.

                if( in_array($resultsCfg['status_code']['not_run'], (array)$status) )

                        $sql = " /* $debugMsg */ SELECT distinct T.tcversion_id,E.build_id,NH.parent_id AS tcase_id " .
                                " FROM {$this->tables['testplan_tcversions']} T " .
                                " JOIN {$this->tables['nodes_hierarchy']} NH ON " .
                                " AND NH.node_type_id={$node_types['testcase_version']} " .
                                " LEFT OUTER JOIN {$this->tables['executions']} E ON T.tcversion_id = E.tcversion_id " .
                                " AND T.testplan_id=E.testplan_id AND E.build_id IN ({$build_in}) $executionPlatformString" .
                                " WHERE T.testplan_id={$id} AND (E.build_id IS NULL) $tcversionPlatformString";

                        $first_results = $this->db->fetchRowsIntoMap($sql,'tcase_id');

                $sql = " SELECT EE.status,SQ1.tcversion_id, NH.parent_id AS tcase_id, COUNT(EE.status) AS exec_qty " .
                        " FROM {$this->tables['executions']} EE, {$this->tables['nodes_hierarchy']} NH," .
                        " (SELECT E.tcversion_id,E.build_id,MAX( AS last_exec_id " .
                        " FROM {$this->tables['executions']} E " .
                        " WHERE E.build_id IN ({$build_in}) $executionPlatformString" .
                        " GROUP BY E.tcversion_id,E.build_id) AS SQ1 " .
                        " WHERE EE.build_id IN ({$build_in}) " .
                        " AND EE.status IN ('" . $status . "') AND NH.node_type_id={$node_types['testcase_version']} " .
                        " AND AND " .
                        " GROUP BY status,SQ1.tcversion_id,NH.parent_id" .
                        " HAVING count(EE.status)= {$num_exec} " ;
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
PHP Version
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Fileszip file icon [^] (39,436 bytes) 2011-12-01 21:09
xml file icon TS01.testsuite-children-testcases.xml [^] (1,422 bytes) 2012-04-14 15:28

- Relationships

-  Notes
fman (administrator)
2011-11-24 13:10

1. please look for similar issues in order to put it in relationship

2. please provide better subject (if platforms are the issue this info is CRITICAL also on subject)

3. please provide detailed steps to reproduce with expected results and actual results.
This info i critical to create test cases that copes with same issue/problem you are facing.

4. when providing a fix always provide full code in zip file with changed pieces marked with YYYYYMMDD - email, this make our work a lot more isser.
paulewog (reporter)
2011-12-01 19:41

1. I tried to look for similar issues but didn't see any. I may have missed them, of course... :)

3. I can try to provide more detailed steps if necessary (or was this a generic request?). It's difficult for me to test, so I tried to put down what appears to be causing it based on fiddling around with my environment.

4. I can provide the full code change if you still need it. I only changed one section.
fman (administrator)
2011-12-01 20:47

>> 3. I can try to provide more detailed steps if necessary (or was this a
>> generic request?)
is not a generic/pre-cooked request, but a needed request.

>> 4. I can provide the full code change if you still need it.
>> I only changed one section.
Please provide full code
paulewog (reporter)
2011-12-01 21:04

I'll attach code in a second; I believe this is how it is reproduced:

1. Have a project with at least two builds and two platforms.
2. Assign two testcases to be run on both platforms.
3. Mark one testcase as executed (e.g., passed) against one build/platform combination.
4. Using the test execution pane, select the platform that has had nothing executed against it yet.
5. Using the test execution filters, select "Not Run" and "ALL Builds" options.

Only one testcase shows up as "not run" with these filters.

Both testcases should show up as not run, because it has not been run on this platform.

Based on my poking around in the code a bit, it looks like one of the SQL queries left out the additional WHERE parts that are necessary when using platforms.
skilletaudio (reporter)
2012-02-08 21:39

I have encountered the same issue on 1.9.3, with postgres 8.4 and can provide reproduction steps:

Summary: 2 platforms, a test case on a test plan, 2 builds. Execute test against platform 1, then change active platform to platform2 and filter for 'Not run on All Builds', test case will be missing from displayed results.

Reproduction steps:

1. Create test plan
2. add 2 platforms to test plan, platform1 and platform2
3. add a single test case, against both platforms
4. Create -two builds-, named build1 and build2
5. click "Execute Tests" on main page
6. In execution tree, ensure platform1 is selected, and build2(should be default)
7. and execute test with result PASSED
8. Change active Platform to Platform2 in left pane, let tree refresh.

Note: Test tree coloring shows test as not run, this is correct as the test is not executed against platform2.

9. Apply filter: Result is Not Run, on All Builds.
Tree refreshes with no test cases contained (0 Not run, 0 passed) even though the test case was not yet executed against platform2.
fman (administrator)
2012-04-14 07:17
edited on: 2012-04-14 07:17

I apologize for so long time to act.

paulewog has found a missing piece - Thanks
Anyway I've done following work (part of refactoring for 1.9.4)
Created a new method to work ONLY on the special situation of requesting NOT RUN.
I've wrote it from scratch but is similar to second query posted on original note by paulewog.
I think will be better save time, when you know that user has requested JUST ONE STATUS and this status is NOT RUN.

I've leave untoched other parts of old method.

Would you mind (paulewogn & skilletaudio) use attached file (.gz), retest an provide feedbak ?


fman (administrator)
2012-04-14 15:28

adding test case in XML format that be useful for testing this implementation
skilletaudio (reporter)
2012-04-17 23:57

Confirmed the supplied test .php file seems to resolve the issue for me.
fman (administrator)
2012-04-18 05:39

Scuse me, I have uploaded one version and THEN REMOVED, because I found other chages to do.
Be still patiente I'm working on improvement on this and on some slow reports.
I hope to have a fix on two weeks more or less.

You will receive notification from mantis
fman (administrator)
2012-09-01 19:59

1.9.4 released

- Issue History
Date Modified Username Field Change
2011-11-24 00:08 paulewog New Issue
2011-11-24 13:10 fman Note Added: 0016068
2011-12-01 19:41 paulewog Note Added: 0016104
2011-12-01 20:47 fman Note Added: 0016106
2011-12-01 21:04 paulewog Note Added: 0016108
2011-12-01 21:09 paulewog File Added:
2012-02-08 21:39 skilletaudio Note Added: 0016354
2012-04-08 09:33 fman Assigned To => fman
2012-04-08 09:33 fman Status new => assigned
2012-04-14 07:17 fman Note Added: 0016585
2012-04-14 07:17 fman Note Edited: 0016585 View Revisions
2012-04-14 07:18 fman File Added: testplan.class.php.gz
2012-04-14 07:22 fman Additional Information Updated View Revisions
2012-04-14 07:23 fman File Deleted: testplan.class.php.gz
2012-04-14 07:23 fman Additional Information Updated View Revisions
2012-04-14 15:28 fman Note Added: 0016586
2012-04-14 15:28 fman File Added: TS01.testsuite-children-testcases.xml
2012-04-14 17:42 fman Status assigned => work in progress
2012-04-17 23:57 skilletaudio Note Added: 0016597
2012-04-18 05:39 fman Note Added: 0016598
2012-08-08 20:00 fman Task Workflow Status => READY FOR TESTING
2012-08-08 20:43 fman Status work in progress => assigned
2012-08-08 20:43 fman Status assigned => resolved
2012-08-08 20:43 fman Fixed in Version => 1.9.4 (2012 Q3 - bug fixing)
2012-08-08 20:43 fman Resolution open => fixed
2012-09-01 19:59 fman Note Added: 0017299
2012-09-01 19:59 fman Status resolved => closed

Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker