reportportal / agent-java-junit

Report Portal agent for JUnit 4
Apache License 2.0
11 stars 17 forks source link

Execution crashes when test class is marked as @Ignore #59

Closed usikraman closed 4 years ago

usikraman commented 4 years ago

RP is able to successfully skip tests(methods) annotated with @Ignore however classes with same annotations causes NullPointerException:

[ERROR] org.apache.maven.surefire.testset.TestSetFailedException: java.lang.NullPointerException [ERROR] at org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures(JUnit4RunListener.java:209) [ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:169) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) [ERROR] Caused by: java.lang.NullPointerException [ERROR] at com.epam.reportportal.junit.ParallelRunningHandler.buildStartTestItemRq(ParallelRunningHandler.java:307) [ERROR] at com.epam.reportportal.junit.ParallelRunningHandler.handleTestSkip(ParallelRunningHandler.java:190) [ERROR] at com.epam.reportportal.junit.ReportPortalListener.testIgnored(ReportPortalListener.java:97) [ERROR] at com.nordstrom.automation.junit.RunAnnouncer.testIgnored(RunAnnouncer.java:92) [ERROR] at org.junit.runner.notification.SynchronizedRunListener.testIgnored(SynchronizedRunListener.java:77) [ERROR] at org.junit.runner.notification.RunNotifier$6.notifyListener(RunNotifier.java:174) [ERROR] at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72) [ERROR] at org.junit.runner.notification.RunNotifier.fireTestIgnored(RunNotifier.java:171) [ERROR] at org.junit.internal.builders.IgnoredClassRunner.run(IgnoredClassRunner.java:16) [ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367) [ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274) [ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) [ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161) [ERROR] ... 3 more

HardNorth commented 4 years ago

Thanks, definitely needs to be fixed.

liamtsava commented 4 years ago

Related to JUnit Foundation library issue: https://github.com/Nordstrom/JUnit-Foundation/issues/62

sbabcoc commented 4 years ago

Prior to the pull request I just submitted, agent-java-junit was using JUnit-Foundation 11.0.2. After upgrading to JUnit-Foundation 11.2.0, I was unable to reproduce the issue described herein.

liamtsava commented 4 years ago

@usikraman please use latest JUnit-Foundation 11.3.0 and don't add RunAnnouncer listener in surefire plugin configuration. In this case it should work fine.