Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "file" attribute to vitest JUnit reporter test case XML elements #5648

Closed
4 tasks done
blytheaw opened this issue May 1, 2024 · 1 comment · Fixed by #5659
Closed
4 tasks done

Add "file" attribute to vitest JUnit reporter test case XML elements #5648

blytheaw opened this issue May 1, 2024 · 1 comment · Fixed by #5659
Labels
p2-nice-to-have Not breaking anything but nice to have (priority) pr welcome

Comments

@blytheaw
Copy link

blytheaw commented May 1, 2024

Clear and concise description of the problem

GitLab CI/CD pipelines allow uploading a JUnit formatted XML file as a test report, and they have a UI that displays the results. One column of this UI is populated by the "file" attribute on each "testcase" element in JUnit xml report. The vitest junit reporter is not currently populating this attribute, so this data is empty in GitLab when using vitest and the default junit reporter.

Suggested solution

Add the "file" attribute with the filename to testcase elements in the Junit XML report output

Alternative

No response

Additional context

No response

Validations

@sheremet-va sheremet-va added pr welcome p2-nice-to-have Not breaking anything but nice to have (priority) and removed enhancement: pending triage labels May 1, 2024
@hi-ogawa
Copy link
Contributor

hi-ogawa commented May 2, 2024

Interesting. Actually the first PR from 2 years ago has screenshots with "Filename" blank #534

Looking at jest-junit's issue jest-community/jest-junit#198, it looks like file is not on par with some spec and they have opt-in addFileAttribute flag, so we can probably do the same.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2-nice-to-have Not breaking anything but nice to have (priority) pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants