Open andyleejordan opened 2 years ago
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. I was trying to verify if Reportportal supports xunit XML files import. I found this class junit/XunitImportHandler.java which only supports junit XML format...
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:
xunit
reporter to junit
, since it's emitting jUnit XMLxunit
reporter that actually emits xUnit XMLThoughts?
Do we have a timeline for when this issue will be closed?
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:
https://github.com/mochajs/mocha/blob/0ea732c1169c678ef116c3eb452cc94758fff150/test/reporters/xunit.spec.js#L322-L453
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.