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

Unable to debug a test, that is failing without mutation #370

Open
eratynsk opened this issue Dec 18, 2024 · 0 comments
Open

Unable to debug a test, that is failing without mutation #370

eratynsk opened this issue Dec 18, 2024 · 0 comments

Comments

@eratynsk
Copy link

Hi!
I'm setting up pitest in java 21 and gradle repo. I have a test failing without mutation, that normally passes green when it's triggered without pitest.

Exception in thread "main" org.pitest.help.PitHelpError: 1 tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite.
See https://pitest.org for more details.
        at org.pitest.coverage.execute.DefaultCoverageGenerator.verifyBuildSuitableForMutationTesting(DefaultCoverageGenerator.java:127)
        at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:109)
        at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:53)
        at org.pitest.mutationtest.tooling.MutationCoverage.runAnalysis(MutationCoverage.java:149)
        at org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:136)
        at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:136)
        at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:63)
        at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:98)
        at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:45)

I wanted to debug it's execution with pitest, but I'm not sure how to do it.
I'm using the following extension config, but breakpoints are not working in the test's code:

configure<PitestPluginExtension> {
    pitestVersion = "1.15.3"
    junit5PluginVersion.set("1.2.1")
    targetClasses.set(setOf("com.example.*"))
    targetTests.set(setOf("com.example.*"))
    verbose=true
    mainProcessJvmArgs.set(listOf("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"))
}

I've seen in existing issue that it's possible to debug the test execution by minion (separate jvm process?), could you please share how to do it?
@szpak

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

1 participant