Closed sspieker-cc closed 3 years ago
After updating the agent-java-junit client to version 5.0.0-BETA-8 (and fudging all of the dependency references within the local repository) I have confirmed that the PowerMockRunner continues to be ignored by the agent tooling.
Can you try agent-java-junit:5.0.0-BETA-9?
It looks like we can't do anything with that, since in this case our upstream library JUnit Foundation is not calling our listener at all.
An issue on JUnit Foundation: https://github.com/sbabcoc/JUnit-Foundation/issues/77
So for those who still want to use PowerMock you must:
@PowerMockRunnerDelegate(BlockJUnit4ClassRunner.class)
to your test classes as here: https://github.com/reportportal/agent-java-junit/blob/develop/src/test/java/com/epam/reportportal/junit/features/powermock/SimplePowermockTest.javaOr it is better to migrate on Mockito or any other framework, since Powermock is too outdated (got last update in 2016) and it's not compatible with Java 11+
When executing test suites using any runner OTHER than PowerMockRunner are reported correctly. However, when PowerMockRunner is utilized, those tests classes are fail to report any results at all to ReportPortal.
ReportPortal installation is version 5 GA.
Agent-java-junit4 dependencies for all projects are:
The runner has been confirmed as the issue as one gradle project did not utilize the powermock api and did not report the results for the three methods contained within. This project was thus updated and so the runner was switched to utilize the @RunWith(MockJUnitRunner.class) and the results from this test class has since been reporting all test results correctly to ReportPortal.
Projects utilize a variety of mockito as well as PowerMock to execute tests. The hope here is that the agent will work with the PowerMockRunner class as well as the others.
Agent-java-junit v5.0.0-BETA-8 could not be tested due to the snapshot compile dependencies for commons-model and client-java.
If these dependencies can be supplied, I will be happy to attempt a run using the updated versions.
Thanks, Scott