-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
🐛 Bug: xUnit XML format is actually JUnit's schema #4758
Comments
Hey @juergba, any follow up on this, am I crazy? |
I'm relieved. I thought I'm missing something as well. Naming things is indeed hard. |
What's even more interesting is that apparently this is not the only case where the names about xunit and junit aren't correct. |
Yes, this is JUnit XML, not XUnit XML. |
@jkrall @tj @boneskull what do you think? |
cc @mochajs/maintenance-crew - looks like this is a long-standing issue that has tripped quite a few folks up. My intuition is we'd want to make a breaking change fix in the next major version that:
Thoughts? |
Do we have a timeline for when this issue will be closed? |
Status update on the issue itself: nobody has protested, so I just marked it as As for timelines, it'll be a while. We've got to get through:
But, we can still review a PR before those two are done! We just won't be able to merge & release it till then. |
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
Hi there,
I feel like I'm crazy, but as far as I can tell, the XML output for Mocha's xUnit reporter is actually JUnit's schema. In short, it's emitting something like:
Which is most definitely the documented JUnit XML schema. Mocha's own tests for the xUnit output confirm this what it's intended to emit:
mocha/test/reporters/xunit.spec.js
Lines 322 to 453 in 0ea732c
However, the two versions of xUnit XML schema (v1 and v2) look radically different from this! For one, the top-level element must be
<assemblies>
, which doesn't exist in Mocha's codebase. And neither use<testcase>
nor<testsuite>
(they both use a<test>
element with further information provided by subelements).I don't know how I'm the first to notice this when this project is used by 1.4 million other things on GitHub, which is why I think I must be wrong, despite staring at the documentation and tests I've just linked that justify this bug is real.
The text was updated successfully, but these errors were encountered: