0

我在我的 maven 构建中运行我的单元测试,但是当我在 GitHub Action 而不是本地运行它时,我得到了以下异常。

我正在使用 maven-surefire-plugin 和 JUnit5。任何想法这里出了什么问题?

2021-11-20T00:11:41.0420543Z [INFO] -------------------------------------------------------
2021-11-20T00:11:41.0421563Z [INFO]  T E S T S
2021-11-20T00:11:41.0422427Z [INFO] -------------------------------------------------------
2021-11-20T00:11:43.4187025Z Nov 20, 2021 12:11:43 AM org.junit.platform.launcher.core.TestExecutionListenerRegistry lambda$notifyEach$1
2021-11-20T00:11:43.6398950Z [INFO] Running util.StringUtilsTests
2021-11-20T00:11:43.6402483Z WARNING: TestExecutionListener [org.junit.platform.launcher.listeners.UniqueIdTrackingListener] threw exception for method: testPlanExecutionStarted(org.junit.platform.launcher.core.InternalTestPlan@2b56f5f8)
2021-11-20T00:11:43.7160620Z java.lang.NoSuchMethodError: 'org.junit.platform.engine.ConfigurationParameters org.junit.platform.launcher.TestPlan.getConfigurationParameters()'
2021-11-20T00:11:43.7178294Z    at org.junit.platform.launcher.listeners.UniqueIdTrackingListener.testPlanExecutionStarted(UniqueIdTrackingListener.java:143)
2021-11-20T00:11:43.7181581Z [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.235 s - in util.StringUtilsTests
2021-11-20T00:11:43.7242679Z    at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.lambda$testPlanExecutionStarted$12(TestExecutionListenerRegistry.java:115)
2021-11-20T00:11:43.7248570Z    at org.junit.platform.launcher.core.TestExecutionListenerRegistry.lambda$notifyEach$1(TestExecutionListenerRegistry.java:67)
2021-11-20T00:11:43.7251537Z    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
2021-11-20T00:11:43.7256781Z    at org.junit.platform.launcher.core.TestExecutionListenerRegistry.notifyEach(TestExecutionListenerRegistry.java:65)
2021-11-20T00:11:43.7913616Z    at org.junit.platform.launcher.core.TestExecutionListenerRegistry.access$200(TestExecutionListenerRegistry.java:32)
2021-11-20T00:11:43.7920723Z    at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.testPlanExecutionStarted(TestExecutionListenerRegistry.java:115)
2021-11-20T00:11:43.7925425Z    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:53)
2021-11-20T00:11:43.7955809Z    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
2021-11-20T00:11:43.7962777Z    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
2021-11-20T00:11:43.8199964Z    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
2021-11-20T00:11:43.8206617Z    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
2021-11-20T00:11:43.8210546Z    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:188)
2021-11-20T00:11:43.8214812Z    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:154)
2021-11-20T00:11:43.8218987Z    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:128)
2021-11-20T00:11:43.8226297Z    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
2021-11-20T00:11:43.8231150Z    at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
2021-11-20T00:11:43.8236435Z    at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
2021-11-20T00:11:43.8265018Z    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
2021-11-20T00:11:43.8281981Z 
2021-11-20T00:11:44.5902456Z [INFO] 
2021-11-20T00:11:44.6869841Z [INFO] Results:
2021-11-20T00:11:44.8426306Z [INFO] 
2021-11-20T00:11:44.8428982Z [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
2021-11-20T00:11:44.8430130Z [INFO] 
4

0 回答 0