MantisBT - TestLink
View Issue Details
0008297TestLinkReports - Test report matrixpublic2018-06-13 14:182018-10-06 12:17
tjosephine 
fman 
normalminoralways
closedfixed 
PCWindows 7
1.9.17 (2018 Q1) 
1.9.18 (2018 Q3) 
MySQL
Chrome v.58
5.6.14
TBD
0008297: Test Result Matrix report - latest execution notes - when more that one tc exists notes are always the same for all tc
After implementing changes from mantis 0008202 and 0008276 on resultsTC.php in order to display latest Notes for latest created build and latest Notes for last execution, the last column added in the Test Result Matrix report "Notes (latest exec)" always returns the notes of the first test case.

Part 1:
------
I execute TC1, TC2 and TC3 against build1, build2 and build3 and make sure to add a note for latest created build3. The report is fine and displays the notes for latest build created.

I re-execute TC1 against build1 with note = N1
I re-execute TC2 against build1 with note = N2
I re-execute TC3 against build1 with note = N3

When running the Test Result Matrix report, the last column "Notes (latest exec)" displays N1 for the 3 test cases TC1, TC2 and TC3. This is not correct. If I understand the changes, we should see N1 for TC1, N2 for TC2 and N3 for TC3.

When looking at resultsTC.php, the code to display the latest exec Notes at line 771 is:

$dfx = current($latestExecution[0]);
if( $fo == FORMAT_XLS) {
   $rows[] = $dfx['execution_notes'];
}
if( $fo == FORMAT_HTML) {
  $rows[] = ['text' => $dfx['execution_notes']];
}

I am surprised to not see the test case ID when looping on the different results.
It sounds like $dfx always returns the same value.

I updated the code with
$dfx = $latestExecution[0][$tcaseID];
Better! when running the report I was able to see N1 for TC1, N2 for TC2 and N3 for TC3.


Part 2:
-------
I continue my testing and decide to use platforms and create P1 and P2 assigned to my test plan.
I add latest build4 and re-execute TC1, TC2 and TC3 for P1 and P2 with notes.
I re-execute the test cases for P1 and P2 against the first build build1 with new notes (New N1, New N2 and New N3)
I run the report again and last column "Notes (latest exec)" shows 'null' for the 3 test cases. Humm..


He took me some times to realize that the ID=0 in $latestExecution[0] corresponds to the platform ID.

I updated the code with
$dfx = $latestExecution[$platformID][$tcaseID];

MAGIC!! it is working fine using platforms or not. The report displays the correct notes for latest created build and for last execution. I can see now New N1 for TC1, New N2 for TC2 and New N3 for TC3.

Please could you confirm if this is the correct implementation?
$dfx = $latestExecution[$platformID][$tcaseID];

Thanks


1-Implement changes fron mantis 0008202 and 0008276
2-Execute TC1, TC2, TC3 against build1, build2, build3 with notes
3-Reexecute TC1, TC2, TC2 against first build build1 with new notes
4-Run Test Result Matrix and check

Add 2 platforms P1 and P2 and repeat steps 2, 3 and 4
Run again Test Result Matrix and check

No tags attached.
png latest_exec.png (12,860) 2018-06-18 19:51
http://mantis.testlink.org/file_download.php?file_id=4944&type=bug
png
Issue History
2018-06-13 14:18tjosephineNew Issue
2018-06-16 16:49fmanNote Added: 0027587
2018-06-16 16:50fmanNote Edited: 0027587bug_revision_view_page.php?bugnote_id=27587#r5520
2018-06-16 18:26fmanNote Edited: 0027587bug_revision_view_page.php?bugnote_id=27587#r5521
2018-06-16 18:26fmanQA Team - Task Workflow Status => TBD
2018-06-16 18:26fmanSummaryTest Result Matrix report doesn't display the correct notes from last execution => Test Result Matrix report doesn't display the correct notes from latest execution
2018-06-16 18:28fmanSummaryTest Result Matrix report doesn't display the correct notes from latest execution => Test Result Matrix report - latest execution notes - when more that one tc exists notes are always the same for all tc
2018-06-16 18:29fmanNote Added: 0027599
2018-06-18 19:51tjosephineFile Added: latest_exec.png
2018-06-18 20:08tjosephineNote Added: 0027605
2018-06-23 16:42fmanNote Added: 0027632
2018-06-23 16:42fmanAssigned To => fman
2018-06-23 16:42fmanStatusnew => feedback
2018-06-28 13:48tjosephineNote Added: 0027648
2018-06-28 13:48tjosephineStatusfeedback => assigned
2018-06-29 20:42fmanStatusassigned => resolved
2018-06-29 20:42fmanFixed in Version => 1.9.18 (2018 Q3)
2018-06-29 20:42fmanResolutionopen => fixed
2018-10-06 12:17fmanNote Added: 0027940
2018-10-06 12:17fmanStatusresolved => closed

Notes
(0027587)
fman   
2018-06-16 16:49   
(edited on: 2018-06-16 18:26)
Thanks for your analysis and patience.
my fault has been doing a refactoring without good test.
also my fault no test with platforms.

I'm going to try to find time to review your code, but at first, glance seems ok.

(0027599)
fman   
2018-06-16 18:29   
please check if this solved the issue

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/a4048256463f932d643c527e4159f8719c7eeef9 [^]
(0027605)
tjosephine   
2018-06-18 20:08   
Yes it is working but one last issue (see attachment).
When there is nothing to display (test cases NOT RUN), the report displays 'null'.

I updated the code like:
If execution_notes exists, then $rows[] = execution_notes or empty string

====
$dfx = $latestExecution[$platformID][$tcaseID];
if( $fo == FORMAT_XLS) {
    if ($dfx['execution_notes']) {
        $rows[] = $dfx['execution_notes'];
    }
    else {
        $rows[] = '';
    }
}
if( $fo == FORMAT_HTML) {
    if ($dfx['execution_notes']) {
        $rows[] = ['text' => $dfx['execution_notes']];
    }
    else {
        $rows[] = ['text' => ''];
    }
}
====

With this change, 'null' disappears and the report looks nice!
Let me know if there is another alternative.
(0027632)
fman   
2018-06-23 16:42   
please try this (your approach refactored)
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/de277670a66b648fa365d9d6dbf3818cb44d868d [^]

thanks a lot!
(0027648)
tjosephine   
2018-06-28 13:48   
Working great! Thank you for the refactoring
(0027940)
fman   
2018-10-06 12:17   
1.9.18 released