docs
docs copied to clipboard
wiki: invalid sample for NUnit 3.0
https://github.com/nunit/docs/wiki/XML-Formats -> http://nunit.org/files/testresult_30.txt
e.g. of error: "environment" must be child of "test-suite", but in the sample its parent is "test-run"
There might be more errors, maybe add a more recent sample...
@nunit/framework-team Would the best approach be to compare current framework code to the docs, or maybe to even come up with an XSD in the framework repo?
I say both. We already have an issue here and in the framework repo about the schema AFAICR
@mikkelbu I have some extra time today. Was anyone else hoping to tackle it?
@jnm2 - The XSD issue has been sitting as something we think we should do but nobody wants to since 2014. I reckon it's all yours! ;-)
https://github.com/nunit/nunit-console/issues/13
😆 Okay. Now I'm confused. I would have thought that the XML was driven totally by the framework, not the engine. Where am I looking to find the source of the XML generation then? In other words, which repo will the xsd reside in?
The XML per-assembly is created in the framework. The engine merges these multiple xml results into a single file (e.g. wraps them in a test-run element.)
I would imagine we'd want an xsd in both repos! I'm not sure if it's possible to support 'nested XSDs'?
Okay! I'll put each thing as close to the defining code as possible. I believe you can include and import XSD, but I'd have to read up on it.
Sounds awesome! 😄
Is there a target namespace we have used in the past?
I'm also leaning towards xs:all everywhere rather than xs:sequence, which gives us the freedom to change the order in which elements appear. Parsers would need to use a string lookup either way because some elements will have minOccurs="0". What do you think?
(I'm writing this with descriptiveness, not prescriptiveness, in mind.)
I'd agree - the structure should be important, the order, not so.
I don't know about namespaces. I think NUnit 2 used to have an XSD - might be worth taking a look over at nunit-legacy.
Here's what I got so far, validates against real-world test XML from the Explore action:
https://github.com/jnm2/nunit/blob/xsd/src/NUnitFramework/framework/Schemas/Test.xsd#L1
That has to come first, because the result format extends this format. What do you think so far?

I'm not very familar with xsd myself, but looks good to start with! This doesn't cover any failure-cases right, yet? e.g. throwing an exception during explore?
Oh, good question! I hadn't thought of that.
@ChrisMaddock Any exceptions thrown during explore are already covered by the normal result format. 👍