You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Morgan (Jira)" <ji...@apache.org> on 2021/07/02 21:57:00 UTC

[jira] [Created] (SUREFIRE-1925) Bogus skipped test reported for class tested immediately after a JUnit 5 @Disabled class

Benjamin Morgan created SUREFIRE-1925:
-----------------------------------------

             Summary: Bogus skipped test reported for class tested immediately after a JUnit 5 @Disabled class
                 Key: SUREFIRE-1925
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1925
             Project: Maven Surefire
          Issue Type: Bug
          Components: JUnit 5.x support, Maven Surefire Plugin
    Affects Versions: 3.0.0-M5, 3.0.0-M4
         Environment: 64-bit HP Workstation running Ubuntu 20.04.2.
Java version: openjdk version "11.0.11".
Maven version: 3.8.1.
Junit versions: 5.6.0 and 5.8.0-M1 both produce the issue.
            Reporter: Benjamin Morgan


If a test class is annotated with org.junit.jupiter.api.Disabled (and is therefore not tested) then the next test class that Maven processes will be reported as having a skipped test that does not in fact exist. This manifests in the .txt file for the second test class in the surefire-reports folder. For example, if the second test class has precisely two methods annotated with org.junit.jupiter.api.Test, neither of which is annotated with org.junit.jupiter.api.Disabled, and if both tests pass then the test report will be like so:

-------------------------------------------------------------------------------
Test set: com.example.SecondTest
-------------------------------------------------------------------------------
Tests run: 3, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.025 s - in com.example.SecondTest

It does not matter whether or not the second test class is in the same package as the first. If the two test methods in the second test class are annotated with Disabled, then the Skipped count is reported as 3.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)