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

How to make sure this plugin also runs testng #358

Closed
nagkumar opened this issue Feb 15, 2024 · 7 comments
Closed

How to make sure this plugin also runs testng #358

nagkumar opened this issue Feb 15, 2024 · 7 comments

Comments

@nagkumar
Copy link

Looking for solution for this

pitest/pitest-testng-plugin#4

@szpak
Copy link
Owner

szpak commented Feb 15, 2024

I'm not sure, if I fully understand the question/problem. In the Gradle plugin documentation where is a section about "generic" PIT plugins (all plugins, except junit5 plugin which has a dedicated support) with the examples in Groovy (build.gradle) and Kotlin (build.gradle.kts): https://github.com/szpak/gradle-pitest-plugin?tab=readme-ov-file#generic-plugin-support-also-junit-5-in-gradle-pitest-plugin-147

That should apply directly to the TestNG plugin. Please let me know, if you encounter any problem with that.

@nagkumar
Copy link
Author

nagkumar commented Feb 23, 2024

as per that limited understanding of the documentation I added (as doc has not said anything about TestNG)

pitest 'org.example.pit.plugins:pitest-custom-plugin:0.42'

image

but it results in error

image

not sure if there is any testng specific plugin that needs to be used in place of "org.example.pit.plugins:pitest-custom-plugin:0.42

@szpak
Copy link
Owner

szpak commented Feb 23, 2024

not sure if there is any testng specific plugin that needs to be used in place of "org.example.pit.plugins:pitest-custom-plugin:0.42

The plugin you would like to use - so the TestNG plugin: "org.pitest:pitest-testng-plugin:1.0.0".

@szpak
Copy link
Owner

szpak commented Mar 5, 2024

@nagkumar Have you been able to improve the situation with my suggestions?

@nagkumar
Copy link
Author

nagkumar commented Mar 6, 2024

dependencies {
    implementation("org.pitest:pitest-testng-plugin:1.0.0")
}

Used this in kotlin gradle build file, the testng related error no more reported.. Thank you.

is the name 'pitest-testng-plugin' correct as I assume plugins should be used in gradle plugins {} block not as implementation..

@szpak
Copy link
Owner

szpak commented Mar 6, 2024

Have you checked pitest("org.pitest:pitest-testng-plugin:1.0.0")?

implementation adds pitest-testng-plugin as compile time dependency to your production code which is not needed.

is the name 'pitest-testng-plugin' correct as I assume plugins should be used in gradle plugins {} block not as implementation..

The plugins {} block contains Gradle plugins (the plugins which help Gradle to build/configure/test/whatever the project) - gradle-pitest-plugin is an example of that plugin. gradle-pitest-plugin itself uses an utility/tool PIT/pitest to run the mutation testing which itself uses PIT's plugins for TestNG. As that, it should be visible for PIT and pitest() (or implementation() - which isn't perfect - makes it).

I hope, that resolves your doubts.

@szpak
Copy link
Owner

szpak commented Apr 19, 2024

Closing as no response for 1,5 months. Feel free to comment/reopen, if you need further assistance.

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

No branches or pull requests

2 participants