Skip to content
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

why junit version has to be explicitly specififed, can the default junit version be used as gradle test similar job #1182

Closed
nagkumar opened this issue Mar 29, 2023 · 4 comments

Comments

@nagkumar
Copy link

nagkumar commented Mar 29, 2023

Any new dependent property is extra, better pickup from what gradle test does

currently in

pitest {
    junit5PluginVersion = '1.1.2'
    //pitestVersion = '1.11.7'
}

we have to give junit5PluginVersion , not giving this will results in

Task :pitest FAILED
8:54:50 am PIT >> INFO : Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue.
8:54:50 am PIT >> INFO : Incremental analysis reduced number of mutations by 0
8:54:50 am PIT >> INFO : Created 1 mutation test units in pre scan
8:54:50 am PIT >> INFO : Sending 2 test classes to minion
8:54:50 am PIT >> INFO : Sent tests to minion
8:54:50 am PIT >> SEVERE : Pitest could not run any tests. Please check that you have installed the pitest plugin for your testing library (eg JUnit 5, TestNG). If your project uses JUnit 4 the plugin is automatically included, but a recent version of JUnit 4 must be on the classpath.
Exception in thread "main" org.pitest.util.PitError: Please check you have correctly installed the pitest plugin for your project's test library (JUnit 5, TestNG, JUnit 4 etc).

@nagkumar
Copy link
Author

safe default configurations is the best way to make it more usage friendly.

@hcoles
Copy link
Owner

hcoles commented Mar 29, 2023

This looks to be an issue with the gradle plugin. I suggest you raise this at https://github.com/szpak/gradle-pitest-plugin.

@hcoles hcoles closed this as completed Mar 29, 2023
@szpak
Copy link
Contributor

szpak commented Mar 29, 2023

@nagkumar It's not so trival - the Gradle plugin would need to know what pitest-junit5-plugin versions are compatible with used junit5(-platform) version. Nevertheless, you can crate a future requests in https://github.com/szpak/gradle-pitest-plugin/issues to discuss the possible options.

Btw, please appreciate that you have a quite clear error message - "missing pitest plugin for JUnit 5". Nevertheless, maybe this could be improved anyway.

@nagkumar nagkumar changed the title why junit verstion be explicitly specififed, can the default junit version be not taken automatically why junit version has to be explicitly specififed, can the default junit version be used as gradle test similar job Apr 7, 2023
@nagkumar
Copy link
Author

nagkumar commented May 19, 2023

https://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/custom.html

can this approach of defining a custom toolchain help here.. just a thought.. not an expert on toolchains though

More details at https://docs.gradle.org/current/userguide/toolchains.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants