reportportal / agent-java-junit

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

Suite run is having waiving issue #89

Closed DuskoV closed 3 years ago

DuskoV commented 3 years ago

If I try to run the test with Suite.class runner, I get this error trace:

java.lang.IllegalStateException: Found multiple candidates for method describeChild(class org.junit.runners.BlockJUnit4ClassRunner) on class org.junit.runners.Suite : [protected org.junit.runner.Description org.junit.runners.Suite.describeChild(java.lang.Object),protected org.junit.runner.Description org.junit.runners.Suite.describeChild(org.junit.runner.Runner),protected org.junit.runner.Description org.junit.runners.ParentRunner.describeChild(java.lang.Object)] at org.apache.commons.lang3.reflect.MethodUtils.getMatchingMethod(MethodUtils.java:784) at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:217) at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:184) at com.nordstrom.automation.junit.LifecycleHooks.invoke(LifecycleHooks.java:412) at com.nordstrom.automation.junit.AtomicTest.<init>(AtomicTest.java:34) at com.nordstrom.automation.junit.RunAnnouncer.newAtomicTest(RunAnnouncer.java:119) at com.nordstrom.automation.junit.RunChild.intercept(RunChild.java:49) at org.junit.runners.Suite.runChild(Suite.java) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run$original$RnPkkO4k(ParentRunner.java:363) at org.junit.runners.ParentRunner.run$original$RnPkkO4k$accessor$9xjv0dUt(ParentRunner.java) at org.junit.runners.ParentRunner$auxiliary$VvzPshSo.call(Unknown Source) at com.nordstrom.automation.junit.LifecycleHooks.callProxy(LifecycleHooks.java:472) at com.nordstrom.automation.junit.Run.intercept(Run.java:58) at org.junit.runners.ParentRunner.run(ParentRunner.java) at org.junit.runners.Suite.run$accessor$EXX90XT2(Suite.java) at org.junit.runners.Suite$auxiliary$Q3fNu3Q4.call(Unknown Source) at com.nordstrom.automation.junit.LifecycleHooks.callProxy(LifecycleHooks.java:472) at com.nordstrom.automation.junit.Run.intercept(Run.java:58) at org.junit.runners.Suite.run(Suite.java) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at org.junit.runner.JUnitCore.run(JUnitCore.java:105) at org.junit.runner.JUnitCore.run(JUnitCore.java:94)

- Error indicates polymorphism waving issue.

Sample Suite class:

@RunWith(Suite.class)

 @Suite.SuiteClasses({
 TestClass_01.class, TestClass_02.class 
}) 

public class Batch_TestingOneAndTwo {

 }


Using version:

com.epam.reportportalagent-java-junit5.0.0
 --- Testing single class, like TestClass_01.class is working awesome! Very smooth, compared to version 4 branch! (well done!) However, version 4 branch doesn't suffer from this issue. Version 4 sends data, but doesn't stop any testing properly.
HardNorth commented 3 years ago

@DuskoV More likely you are using old, incompatible version of JUnit-Foundation which is left from V4, since we have tests which test specifically Suites: https://github.com/reportportal/agent-java-junit/blob/develop/src/test/java/com/epam/reportportal/junit/features/suites/SimpleSuiteClass.java

And even Suite of Suites: https://github.com/reportportal/agent-java-junit/blob/develop/src/test/java/com/epam/reportportal/junit/features/suites/SuiteOfSuitesClass.java

They won't pass if it would fail on startup.

So please update JUnit-Foundation, or even better, use JUnit-Foundation from transitive dependency.

Another issue, which might be here is an old version of JUnit 4. The recommendation is the same, please ensure that you use it from transitive dependency.

HardNorth commented 3 years ago

Abandoned