Public bug reported:

[Impact]
The jtdiff tool allows the user to point to a jtreg test report file, but it 
will reject any file that is not named 'summary.txt'. This completely prevents 
comparing 2 valid test summary files in the same directory, as they can't both 
be named summary.txt.

As an OpenJDK maintainer I usually do comparisons between different test
runs and this restriction requires me to put each file under a separate
directory, which usually adds extra unnecessary logic to scripts that
automate such comparisons. I do use it in automated scripts in jenkins
and autopkgtests, so I would like to see this backported to Bionic,
Focal, and Groovy.

Ideally jtdiff should not care about the file name at all, either it can
open it or not. Still, as accepting *any* file is a significant behavior
change, I proposed that it accepts all files "ending" in summary.txt -
it is also a very minimal and easy change to do on the source code
(using String.endsWith instead of String.equals).


[Test Case]
1) Create a summary.txt file with the one-line content of:
api/java_applet/Applet/AccessibleApplet/index.html#AccessibleContext            
                                                                                
             Passed. test cases: 1; all passed
2) Copy that file to second-summary.txt
3) Try to use jtdiff to compare both files, see that it fails
$ jtdiff -format:text second-summary.txt summary.txt
Error: File not recognized: second-summary.txt
4) And the exit code is 2
$ echo $?
2

Expected:
jtdiff should accept any file name that ends with 'summary.txt'.

[Where problems could occur]
- On the Ubuntu archive it should not cause any problems, as only openjdk-8 and 
openjdk-lts actually depend on it and I only use it against existing and valid 
summary.txt files.
- For users, it can regress if the user was counting on jtdiff failing and 
exiting with an error code 2 when given a file not named "summary.txt". 
Automated scripts that do test result comparison come to mind. Still, this is a 
highly irregular use, as it would be unexpected to have a script/user providing 
'invalid' test summary files with the expectation for it it to fail.


[Other Info]
To reduce the risk of regressions, the proposed fix will change a 
filename.equals("summary.txt") into filename.endsWith("summary.txt"), this way 
it will only accept the smaller set of files when compared to accepting any 
file.

** Affects: jtreg (Ubuntu)
     Importance: Wishlist
     Assignee: Tiago Stürmer Daitx (tdaitx)
         Status: Confirmed

** Changed in: jtreg (Ubuntu)
   Importance: Undecided => Wishlist

** Changed in: jtreg (Ubuntu)
     Assignee: (unassigned) => Tiago Stürmer Daitx (tdaitx)

** Changed in: jtreg (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1904070

Title:
  jdiff should be less strict about the summary.txt filename

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/jtreg/+bug/1904070/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to