andpab commented on PR #564: URL: https://github.com/apache/maven-surefire/pull/564#issuecomment-1363233419
I can confirm that this PR fixes the issue for the setup of the original reporter at least - although I had to modify the setup slightly, making the abstract class an inner class, making the implementations non-static and adding `@Nested`: ```java package surefire2032; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; public class Test1 { @Tag("red") @Nested public class RedTest extends TagTest { } @Disabled @Tag("orange") @Nested public class OrangeTest extends TagTest { } abstract class TagTest { @Test public void test1() { // Do Nothing } @Test public void test2() { // Do Nothing } } } ``` Console output: ``` [INFO] Running surefire2032.Test1 [INFO] Running surefire2032.Test1$OrangeTest [WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.008 s - in surefire2032.Test1$OrangeTest [INFO] Running surefire2032.Test1$RedTest [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 s - in surefire2032.Test1$RedTest [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.042 s - in surefire2032.Test1 [INFO] [INFO] Results: [INFO] [WARNING] Tests run: 4, Failures: 0, Errors: 0, Skipped: 2 ``` XML output: ``` $ cat target/surefire-reports/TEST-surefire2032.Test1\$OrangeTest.xml <?xml version="1.0" encoding="UTF-8"?> <testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd" version="3.0" name="surefire2032.Test1$OrangeTest" time="0.008" tests="2" errors="0" skipped="2" failures="0"> <properties/> <testcase name="test1" classname="surefire2032.Test1$OrangeTest" time="0"> <skipped message="class surefire2032.Test1$OrangeTest is @Disabled"/> </testcase> <testcase name="test2" classname="surefire2032.Test1$OrangeTest" time="0"> <skipped message="class surefire2032.Test1$OrangeTest is @Disabled"/> </testcase> </testsuite> $ cat target/surefire-reports/TEST-surefire2032.Test1\$RedTest.xml <?xml version="1.0" encoding="UTF-8"?> <testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd" version="3.0" name="surefire2032.Test1$RedTest" time="0.023" tests="2" errors="0" skipped="0" failures="0"> <properties> ... </properties> <testcase name="test1" classname="surefire2032.Test1$RedTest" time="0.012"/> <testcase name="test2" classname="surefire2032.Test1$RedTest" time="0.002"/> </testsuite> ``` $ cat target/surefire-reports/TEST-surefire2032.Test1.xml <?xml version="1.0" encoding="UTF-8"?> <testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd" version="3.0" name="surefire2032.Test1" time="0.046" tests="0" errors="0" skipped="0" failures="0"> <properties> ... </properties> </testsuite> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org