[
https://issues.apache.org/jira/browse/SUREFIRE-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Osipov closed SUREFIRE-1841.
------------------------------------
Resolution: Cannot Reproduce
I get with both M3 and M4 the same results:
{noformat}
D:\Entwicklung\Projekte\junit-deptest\demo [master ≡ +0 ~1 -0 !]> mvn test
-Pintegration -pl demo-integration
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
com.example.demo:demo:pom:0.0.1-SNAPSHOT
[WARNING] 'parent.relativePath' of POM com.example.demo:demo:0.0.1-SNAPSHOT
(D:\Entwicklung\Projekte\junit-deptest\demo\pom.xml) points at
test.group:surefire-dependency-test instead of
org.springframework.boot:spring-boot-starter-parent, please verify your project
structure @ line 5, column 10
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten
the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[INFO]
[INFO] -----------------< com.example.demo:demo-integration >------------------
[INFO] Building demo-integration 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @
demo-integration ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
D:\Entwicklung\Projekte\junit-deptest\demo\demo-integration\src\main\resources
[INFO] skip non existing resourceDirectory
D:\Entwicklung\Projekte\junit-deptest\demo\demo-integration\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @
demo-integration ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @
demo-integration ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @
demo-integration ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) @
demo-integration ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
Starting EndpointsTest...
Finished EndpointsTest in 69 ms
Begin testGetHeartbeat...
End testGetHeartbeat
Finished EndpointsTest in 85 ms
Finished EndpointsTest in 85 ms
[ERROR] Tests run: 7, Failures: 4, Errors: 0, Skipped: 3, Time elapsed: 0.539 s
<<< FAILURE! - in TestSuite
[ERROR] afterMethod(com.example.demo.integration.suite.EndpointsTest) Time
elapsed: 0.385 s <<< FAILURE!
java.lang.NullPointerException
at
com.example.demo.integration.suite.EndpointsTest.afterMethod(EndpointsTest.java:28)
[ERROR] beforeMethod(com.example.demo.integration.suite.EndpointsTest) Time
elapsed: 0.385 s <<< FAILURE!
java.lang.NullPointerException
at
com.example.demo.integration.suite.EndpointsTest.beforeMethod(EndpointsTest.java:23)
[ERROR] beforeMethod(com.example.demo.integration.suite.EndpointsTest) Time
elapsed: 0 s <<< FAILURE!
java.lang.NullPointerException
at
com.example.demo.integration.suite.EndpointsTest.beforeMethod(EndpointsTest.java:23)
[ERROR] afterMethod(com.example.demo.integration.suite.EndpointsTest) Time
elapsed: 0 s <<< FAILURE!
java.lang.NullPointerException
at
com.example.demo.integration.suite.EndpointsTest.afterMethod(EndpointsTest.java:28)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]
com.example.demo.integration.suite.EndpointsTest.afterMethod(com.example.demo.integration.suite.EndpointsTest)
[ERROR] Run 1: EndpointsTest.afterMethod:28 NullPointer
[ERROR] Run 2: EndpointsTest.afterMethod:28 NullPointer
[INFO]
[ERROR]
com.example.demo.integration.suite.EndpointsTest.beforeMethod(com.example.demo.integration.suite.EndpointsTest)
[ERROR] Run 1: EndpointsTest.beforeMethod:23 NullPointer
[ERROR] Run 2: EndpointsTest.beforeMethod:23 NullPointer
[INFO]
[INFO]
[ERROR] Tests run: 4, Failures: 2, Errors: 0, Skipped: 2
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.652 s
[INFO] Finished at: 2024-06-04T23:43:25+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test (default-test) on
project demo-integration: There are test failures.
[ERROR]
[ERROR] Please refer to
D:\Entwicklung\Projekte\junit-deptest\demo\demo-integration\target\surefire-reports
for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump,
[date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
D:\Entwicklung\Projekte\junit-deptest\demo [master ≡]>
D:\Entwicklung\Projekte\junit-deptest\demo [master ≡]> mvn test -Pintegration
-pl demo-integration
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
com.example.demo:demo:pom:0.0.1-SNAPSHOT
[WARNING] 'parent.relativePath' of POM com.example.demo:demo:0.0.1-SNAPSHOT
(D:\Entwicklung\Projekte\junit-deptest\demo\pom.xml) points at
test.group:surefire-dependency-test instead of
org.springframework.boot:spring-boot-starter-parent, please verify your project
structure @ line 5, column 10
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten
the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[INFO]
[INFO] -----------------< com.example.demo:demo-integration >------------------
[INFO] Building demo-integration 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @
demo-integration ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
D:\Entwicklung\Projekte\junit-deptest\demo\demo-integration\src\main\resources
[INFO] skip non existing resourceDirectory
D:\Entwicklung\Projekte\junit-deptest\demo\demo-integration\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @
demo-integration ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @
demo-integration ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @
demo-integration ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @
demo-integration ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
Starting EndpointsTest...
Finished EndpointsTest in 83 ms
Begin testGetHeartbeat...
End testGetHeartbeat
Finished EndpointsTest in 99 ms
Finished EndpointsTest in 103 ms
[ERROR] Tests run: 7, Failures: 4, Errors: 0, Skipped: 3, Time elapsed: 0.558 s
<<< FAILURE! - in TestSuite
[ERROR] com.example.demo.integration.suite.EndpointsTest.afterMethod Time
elapsed: 0.402 s <<< FAILURE!
java.lang.NullPointerException
at
com.example.demo.integration.suite.EndpointsTest.afterMethod(EndpointsTest.java:28)
[ERROR] com.example.demo.integration.suite.EndpointsTest.beforeMethod Time
elapsed: 0.402 s <<< FAILURE!
java.lang.NullPointerException
at
com.example.demo.integration.suite.EndpointsTest.beforeMethod(EndpointsTest.java:23)
[ERROR] com.example.demo.integration.suite.EndpointsTest.beforeMethod Time
elapsed: 0.004 s <<< FAILURE!
java.lang.NullPointerException
at
com.example.demo.integration.suite.EndpointsTest.beforeMethod(EndpointsTest.java:23)
[ERROR] com.example.demo.integration.suite.EndpointsTest.afterMethod Time
elapsed: 0.008 s <<< FAILURE!
java.lang.NullPointerException
at
com.example.demo.integration.suite.EndpointsTest.afterMethod(EndpointsTest.java:28)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] com.example.demo.integration.suite.EndpointsTest.afterMethod
[ERROR] Run 1: EndpointsTest.afterMethod:28 NullPointer
[ERROR] Run 2: EndpointsTest.afterMethod:28 NullPointer
[INFO]
[ERROR] com.example.demo.integration.suite.EndpointsTest.beforeMethod
[ERROR] Run 1: EndpointsTest.beforeMethod:23 NullPointer
[ERROR] Run 2: EndpointsTest.beforeMethod:23 NullPointer
[INFO]
[INFO]
[ERROR] Tests run: 4, Failures: 2, Errors: 0, Skipped: 2
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.264 s
[INFO] Finished at: 2024-06-04T23:43:44+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) on
project demo-integration: There are test failures.
[ERROR]
[ERROR] Please refer to
D:\Entwicklung\Projekte\junit-deptest\demo\demo-integration\target\surefire-reports
for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump,
[date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
{noformat}
> <suiteXmlFiles> no longer finds tests starting with 3.0.0-M4
> ------------------------------------------------------------
>
> Key: SUREFIRE-1841
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1841
> Project: Maven Surefire
> Issue Type: Bug
> Components: TestNG support
> Affects Versions: 3.0.0-M4
> Reporter: BJ Cardon
> Priority: Major
>
> Hello. I have a fairly simple multi-module project where I'm using the
> surefire plugin to execute a series of integration tests in one of the
> modules. I am doing this by defining a profile in the module that runs one of
> my suite XML files.
> Here is my profile definition in the POM.
> {noformat}
> <profile>
> <id>acceptance</id>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>3.0.0-M4</version>
> <configuration>
> <useFile>false</useFile>
> <suiteXmlFiles>
>
> <suiteXmlFile>src/test/resources/jenkins/acceptance-testng.xml</suiteXmlFile>
> </suiteXmlFiles>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </profile>{noformat}
> In previous versions of the plugin, including in 3.0.0-M3, this works and the
> suite is found and executed. In 3.0.0-M4, the test suite is not found and the
> tests don't run at all. The same behavior is observed in 3.0.0-M5.
> Here is my `acceptance-testng.xml` file
> {noformat}
> <!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
> <suite name="Acceptance Test Suite" verbose="1">
> <test name="Group 1 Acceptance Tests" parallel="methods" thread-count="4">
> <groups>
> <run>
> <!-- to exclude a test from Acceptance test run, add test to
> one of these groups -->
> <exclude name="fragile"/>
> <exclude name="load"/>
>
> <!-- This testuite will only run tests that belong to the
> 'acceptance' group -->
> <include name="acceptance"/>
> </run>
> </groups>
> <classes>
> <class name="com.company.app.integration.suite.rest.AppRestTest"/>
> <class
> name="com.company.app.integration.suite.rest.AppRestErrorTest"/>
> <class name="com.company.app.integration.suite.rest.AppAuthTest"/>
> <class name="com.company.app.integration.suite.rest.AppLoadTest"/>
> </classes>
> </test>
> <test name="Group 2 Acceptance Tests" parallel="classes" thread-count="4">
> <groups>
> <run>
> <!-- to exclude a test from Acceptance test run, add test to
> one of these groups -->
> <exclude name="fragile"/>
> <exclude name="load"/>
> <!-- This testuite will only run tests that belong to the
> 'acceptance' group -->
> <include name="acceptance"/>
> </run>
> </groups>
> <classes>
> <class
> name="com.company.app.integration.suite.vendor.VendorRestTest"/>
> <class
> name="com.company.app.integration.suite.vendor.VendorRestErrorTest"/>
> <class
> name="com.company.app.integration.suite.vendor.VendorAuthTest"/>
> <class
> name="com.company.app.integration.suite.vendor.VendorLoadTest"/>
> </classes>
> </test>
> </suite>{noformat}
> As stated above, this broke sometime between 3.0.0-M3 and 3.0.0-M4. I tried
> looking through the changelog (on a tangent, the changelogs linked from the
> ASF page require creating an account in Jira which seems odd) but it seems
> like a number of fairly large changes were made in 3.0.0-M4 that could have
> been to blame for this change in behavior.
> Let me know if I can provide any additional context.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)