Feature #6265
generate junit-compatible xml results for output
100%
Related issues
History
#1 Updated by Greg Shah over 4 years ago
Customers are using tools such as gitlab for code repo (commercial git) and for CI/CD pipelines. They have unit test reporting https://docs.gitlab.com/ee/ci/unit_test_reports.html. They use the junit xml format to report in the UI. https://www.ibm.com/docs/en/developer-for-zos/14.1.0?topic=formats-junit-xml-format
This task is meant to add the junit xml format as an output option for our results.
#2 Updated by Greg Shah almost 4 years ago
Chris: Can you post your code that implements this feature? I'd like to start with it.
#3 Updated by Chris Weaver almost 4 years ago
- File JunitGenerator.java
added
Hi Greg, It's not much but is a clone of ReportGenerator.java, I attached the file. To include, I modified Harness.java to include:
// generate junit xml report for the results JunitGenerator junit = new JunitGenerator(testPlan, rc); junit.generate();
Right after reports.generate();
#4 Updated by Tomasz Domin over 1 year ago
- % Done changed from 0 to 10
- Status changed from New to WIP
- Assignee set to Tomasz Domin
#5 Updated by Tomasz Domin over 1 year ago
- % Done changed from 10 to 70
Created task branch 6265a, implemented JUnit report exporting, Exported files are successfully imported into Eclipse.
Testing with regression tests to get JUnit legacy XML reports in the end.
#6 Updated by Tomasz Domin over 1 year ago
Tomasz Domin wrote:
Created task branch
6265a, implemented JUnit report exporting, Exported files are successfully imported into Eclipse.
Testing with regression tests to get JUnit legacy XML reports in the end.
Tested with regression tests, looks good after importing report back to Eclipse.
#7 Updated by Tomasz Domin over 1 year ago
- Related to Support #9270: design and implement an approach for executing multi-session 4GL testcases added
#8 Updated by Greg Shah over 1 year ago
- reviewer Greg Shah added
The % Done is 70%. What is left to do?
#9 Updated by Tomasz Domin over 1 year ago
- % Done changed from 70 to 100
Greg Shah wrote:
The % Done is 70%. What is left to do?
The mapping is pretty basic, and I was considering to extend it (Junit is very limited on information it produces) But its true, it is 100% for a current functionality.
#10 Updated by Greg Shah over 1 year ago
Are the changes already included in 9270a?
#11 Updated by Tomasz Domin over 1 year ago
Greg Shah wrote:
Are the changes already included in 9270a?
No, its a separate feature. Thats why I was waiting for #9270 to be merged so I could rebase and send it for review.
#12 Updated by Tomasz Domin about 1 year ago
- File junit_report_1.png added
- File cross_session_junit.xml
added
Rebased to harness/38, fixed rebasing errors, pushed harness/6265a/42
Reversed name and classname attributes, not sure if it should stay that way.
Pushed harness/6265a/43
Tested with testcases dirty-share tests.
Attached a sample generated file
Its displayed in Eclipse like in following screenshot (note I've selected failed test to display failure cause):

#13 Updated by Tomasz Domin about 1 year ago
- Status changed from WIP to Review
- reviewer Constantin Asofiei added
Cleaned up source code, pushed up harness/6265a/44
Please review.
#14 Updated by Greg Shah 8 months ago
- Status changed from Review to Internal Test
Code Review Harness 6265a Revisions 39 through 44
I didn't realize that you have both the JUnit report output AS WELL AS directives to read externally created JUnit reports (needed for #9270?). Anyway, the code looks good.
Is there any testing needed?
#15 Updated by Tomasz Domin 7 months ago
Greg Shah wrote:
Code Review Harness 6265a Revisions 39 through 44
I didn't realize that you have both the JUnit report output AS WELL AS directives to read externally created JUnit reports (needed for #9270?). Anyway, the code looks good.
Is there any testing needed?
That feature is not critical, its more like it allows integrating with IDEs or build pipelines.
So testing would be done during integration with Jenkins I guess.
#17 Updated by Tomasz Domin 5 months ago
- Status changed from Merge Pending to Test
Greg Shah wrote:
You can merge it.
Harness branch 6265a has been merged to harness trunk revision 39.
#19 Updated by Tomasz Domin 5 months ago
Greg Shah wrote:
Is the documentation updated with details on how to use it?
Not yet I guess. Give me a minute.
#20 Updated by Tomasz Domin 5 months ago
Greg Shah wrote:
Is the documentation updated with details on how to use it?
I've added description of a new command line option -junit <junit_filename> = export test result to file in JUnit legacy format Documentation