[Bug] JUnit Reporter doesn't include ignored methods
See original GitHub issueTestNG Version
6.9.13.6 (latest available)
Expected behavior
I believe that JUnitReportReporter
should be compliant with the JUnit 4.12 rules and thus should include the disabled/ ignored tests (the ones marked with @Test(enabled = false)
in the XML report under junitreports/
directory.
Yes, I know, I know, this is not how TestNG treats ignored tests - but if we are going to produce a JUnit-compliant test report, then I guess we should stick to the JUnit rules 😃
Actual behavior
Now, TestNG doesn’t generate absolutely no info about such test in the output xml report.
Is the issue reproductible on runner?
Tested via Maven.
Test case sample
@Test(enabled = false)
public void should_be_ignored() {
assertEquals("abcd", "abc");
}
I would expect to see followig entry in the generated JUnit report:
<testcase time="0" classname="com.myproject.AbcTest" name="should_be_ignored">
<skipped/>
</testcase>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:14 (2 by maintainers)
Top Results From Across the Web
What can cause JUnit to disregard @Ignore annotations?
The easiest way to do this is to either change the test name so it is not prefixed by test (now it shouldn't...
Read more >JUnit 5 User Guide
Entire test classes or individual test methods may be disabled via the @Disabled annotation, via one of the annotations discussed in Conditional ...
Read more >Narrowing the focus with analysis scope
There are many cases where you do not want to analyze every source file in your project. In such cases, you can adjust...
Read more >ArchUnit User Guide
ArchUnit is a free, simple and extensible library for checking the architecture of your Java code. That is, ArchUnit can check dependencies between...
Read more >Allure Framework
Typically it might be a junit-style xml report generated by nearly every popular test framework. For example, suppose you have test reports ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@krmahadevan sure, let me explain:
It is Ok that you cannot see the attribute
ignored
there. Because JUnit-style of report doesn’t useignored
word, it just uses theskipped
for this purpose. In the JUnit world they are synonyms. Although in the TestNG world they aren’t synonyms.Please look at my explanation above. They are synonyms.
I think your confusion is caused by differences in the JUnit and TestNG possible test statues. Basically:
JUnit has four possible test statuses:
While TestNG has so far just three (please correct me if I’m wrong) possible test statuses:
So TestNG has no equivalent for the status
SKIPPED
from JUnit (although it has already status with the same name, but for a totally different purpose). This is probably root of a confusion.On the other hand: JUnit has never had any notion of dependency between tests, so there is no equivalent of the TestNG
SKIPPED
status.So thanks to your work there is a new status in the TestNG which is called
IGNORED
- which will be/ should be an equivalent forSKIPPED
status from junit. Because so far, end user was totally not aware of how many tests were actually permanently disabled in a test suite. Now it will change.Thanks, and please ping me if something is not clear.
Ps. @cbeust , @juherr please correct me if I was wrong somewhere above.
@juherr Thank you. Can you please help approve the PR and kindly help it get merged ?