-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pitest cannot run the coverage test suite with JUnit 5.9.1 parameterized tests with method source #69
Comments
After investigating this and https://junit.org/junit5/docs/5.9.1/release-notes/ I've found that one way to fix this is to release a new version of the pitest-junit5-plugin where the The problem is that JUnit Platform seems to be sufficiently backwards compatible so that it can be bumped on its own in pitest-junit5-plugin. |
Thanks @davidburstrom, I'll try and take a proper look at this tomorrow. On the face of it the platform should be at provided scope so this sort of issue wouldn't happen. I have a feeling there was a reason why this couldn't be done though. |
I'm creating a PR as we speak :) |
By bundling the shaded 1.9.1 version of JUnit Platform, it addresses issues finding the method org.junit.platform.commons.util.CollectionUtils.isConvertibleToStream which is required by JUnit Jupiter 5.9.1. The JUnit Platform is backwards compatible with older versions of Jupiter, at least back to 5.8.2.
Yes, agreed, I don't quite see why the JUnit libraries should be shaded. I vaguely remember seeing issues with this before, where the shaded versions weren't compatible with other JUnit dependencies on the classpath. It should be easy enough for them to be provided, and instead add some detection in the plugin that can verify that the versions are within bounds, or adding compatibility layers. |
Build with JUnit Platform 1.9.1 to support JUnit Jupiter 5.9.1 #69
It looks like the bug is still present if you omit the For example, PITest will not instrument @MethodSource
@ParameterizedTest
void someTests(TestCase testCase) {
// ...
}
static List<TestCase> someTests() { but if we specify manually the method name it will work: @MethodSource("someTests")
@ParameterizedTest
void someTests(TestCase testCase) {
// ...
}
static List<TestCase> someTests() { |
@Allsimon Could you open a new issue and provide a minimal project which reproduces this issue for you. From a quick play parameterized tests without and explicit method source seem to work correctly. |
With jUnit 5.9.2, the bug appears in a lot of cases again. |
@MiklosKiss82 Something looks to have changed internally in junit platform between 1.9.1 and 1.9.2. Releasing a build (1.1.2) against 1.9.2 now, which may solve the issue. If not, can you create a minimal project that reproduces the problem. |
Thank you very much. At first sight, it does solve the problem. |
Something has changed internally between JUnit 5.9.0 and 5.9.1, because now all tests that use
@org.junit.jupiter.params.ParameterizedTest
with@org.junit.jupiter.params.provider.MethodSource
are failing. The verbose logging doesn't print any failure message, but I can see that the indicated method doesn't even get invoked.I don't have anything public that reproduces this issue at this point, sorry.
Using Pitest 1.9.5 with pitest JUnit plugin version 1.0.0.
The text was updated successfully, but these errors were encountered: