Community
Participate
Working Groups
Created attachment 135565 [details] Example Junit xml report Another JUnit 4 one. If a JUnit4 test is annotated @Ignore, the resulting xml generated (e.g. when running mvn test) contains <skipped/> This causes an error when opening the file. Try opening the attached with E3.5M7, and you'll get: The test run could not be imported from file 'C:\Projects\workspace\abdera\adapters\filesystem\target\surefire-reports\TEST-org.apache.abdera.protocol.server.test.filesystem.FilesystemTest.xml'. unknown node 'skipped'
The JUnit view understands XML files from the Ant JUnit task and files exported from the JUnit view. The Ant task just swallows ignored tests. Files from the JUnit view add an attribute 'ignored', e.g.: <testcase name="ignored" classname="pack.Failures" time="0.0" ignored="true"/> No plans to add other formats unless the JUnit Ant task output is updated, see https://issues.apache.org/bugzilla/show_bug.cgi?id=43969
Mmm.. not sure I follow what you're saying. Are you saying that E3.5 supports: - It's own exports - JUnit4 run from Ant but that JUnit4 run from Maven is creating the problem by adding that attribute in? Sorry.. don't have time to go into the code - just trying to get clarity on where things might go with this, e.g. whether it's worth me looking at a patch.
> Are you saying that E3.5 supports: > - It's own exports > - JUnit4 run from Ant > > but that JUnit4 run from Maven is creating the problem by adding that attribute > in? Yep. The basic problem is that JUnit doesn't specify a standard format for test result files. The Ant people created their own report format for JUnit 3, and other tools took over their format. Since nobody took the time to update the Ant task to JUnit 4 completely (their JUnit task just wraps JUnit 4 tests into a JUnit4TestAdapter), tools started to add their own elements and attributes to express JUnit 4 features. We could add support for the <skipped> tag, or be more forgiving and just skip unknown content. It's too late for 3.5, but patches would be welcome for 3.6. @see TestRunHandler
Created attachment 146764 [details] Marks <skipped/> node as an ignored test when importing [file is mod of src from 3.6 nightly 20090905] (sorry no patch.. I'm behind a firewall blocking CVS access)
Created attachment 146765 [details] Adds NODE_SKIPPED constant [file is mod of src from 3.6 nightly 20090905]
Attachments are a simple and safe change that mirror the skipping of stdout and stderr nodes, except it calls fTestCase.setIgnored(true) to correctly mark the test case in the UI. Can you get this in for M2, and perhaps even consider for 3.5.2?
Thanks, released to HEAD. Although the change is small and looks safe, it is an enhancement, not a regression, and not a widely-experienced problem, so I'm afraid this doesn't qualify for 3.5.2.