Missing testsuite name in JUnit reports
I have checked the following:
- [x] I have searched existing issues and found nothing related to my issue.
This bug is:
- [ ] making Bruno unusable for me
- [ ] slowing me down but I'm able to continue working
- [ ] annoying
- [x] this feature was working in a previous version but is broken in the current release.
Bruno version
2.2.1
Operating System
macOS, Linux
Describe the bug
The recent Bruno CLI 2.2.1 introduced a bug where generated JUnit reports are missing a testsuite name. This causes downstream tools (in our case dorny/test-reporter) to fail.
I tested this against 2.1.0 where it is working well. I tried to test against 2.2.0 as well, however there the report generation fails because of skipped tests (an issue that was fixed in the latest release).
Screenshots/Live demo link
Here's is a (sanitized) diff of the two reports, generated by v2.1.0 and v2.2.1 respectively:
--- junit-dev-210-head.xml 2025-04-24 16:26:01
+++ junit-dev-221-head.xml 2025-04-24 16:26:12
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<testsuites>
- <testsuite name="valid-event" errors="0" failures="0" skipped="0" tests="2" timestamp="2025-04-24T22:21:08.103" hostname="my-host" time="0.449">
- <testcase name="res.status eq 200" status="pass" classname="some-class-name" time="0.224"/>
- <testcase name="res.body.code eq 0" status="pass" classname="some-class-name" time="0.224"/>
+ <testsuite errors="0" failures="0" skipped="0" tests="2" timestamp="2025-04-24T22:23:41.012" hostname="my-host" time="0.366">
+ <testcase name="res.status eq 200" status="pass" classname="some-class-name" time="0.183"/>
+ <testcase name="res.body.code eq 0" status="pass" classname="some-class-name" time="0.183"/>
</testsuite>
- <testsuite name="missing-authorization" errors="0" failures="0" skipped="0" tests="2" timestamp="2025-04-24T22:21:08.103" hostname="my-host" time="0.094">
- <testcase name="res.status eq 401" status="pass" classname="some-class-name" time="0.047"/>
- <testcase name="res.body.code eq 2" status="pass" classname="some-class-name" time="0.047"/>
+ <testsuite errors="0" failures="0" skipped="0" tests="2" timestamp="2025-04-24T22:23:41.012" hostname="my-host" time="0.086">
+ <testcase name="res.status eq 401" status="pass" classname="some-class-name" time="0.043"/>
+ <testcase name="res.body.code eq 2" status="pass" classname="some-class-name" time="0.043"/>
</testsuite>
You can see how the <testsuite> entries are missing the name in 2.2.1.
Same here, json reports not generated properly, making our downstream tools to don't parse the json file results as before
Hey @amaechler @paubaezaroman
We have released a patch v2.2.2 that fixes this issue.
I have still same issue, I have seen that is mainly the "summary" and "suitename" that are missing
$ bru --version 2.2.2
after doing a diff: $ perl colordiff.pl <(jq -S . ../results.json) <(jq -S . ../results2.json)
< ], < "summary": { < "failedAssertions": 1, < "failedRequests": 0, < "failedTests": 0, < "passedAssertions": 9, < "passedRequests": 6, < "passedTests": 0, < "skippedRequests": 0, < "totalAssertions": 10, < "totalRequests": 6, < "totalTests": 0 < }
< "suitename": "Parasoft-onprem-DataRepo",
Thanks for the quick turnaround @helloanoop. I confirmed that v2.2.2 contains the name of the request again.
One change I noticed is that we now use meta.name of the request, whereas before we used the filenames (folder/filename). Could I suggest that we prefix the testsuite name with the folder's meta.name if it exists, something like folder-name / request-name?
We run a whole bruno collection with many folders, and some requests share the same name (just different folders), so the folder name would be useful to have in there to distinguish between different requests.
Example from 2.1.0 vs 2.2.2:
- <testsuite name="scenarios/test-event-processing/1-create-pipeline" ... />
+ <testsuite name="Create New Pipeline" ... />
Ideally, the name would be Scenarios / Test Event Processing / Create New Pipeline (based on the meta.name of either the folders or requests).
Any update on when this last comment can be looked at? Would really help us too. Thanks!
This is useful and the PR is pending review for more than one month. I believe this also satisfies #4116