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

Android: tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite. #1335

Open
MonkeyMiguelS opened this issue Jul 2, 2024 · 3 comments

Comments

@MonkeyMiguelS
Copy link

MonkeyMiguelS commented Jul 2, 2024

I'm having a lot of issues trying to make Pitest run against my Android project. I've solved a lot of problems related with Java/Gradle/Kotlin versions but now I'm stuck in a custom Pitest error:

Exception in thread "main" org.pitest.help.PitHelpError: 69 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 don't know why am I getting this exception when, as you can see, the tests pass successfully and the line coverage is around 95%:

image

What am I doing wrong? Where's the issue? For further details, I'm running with Java JetBrains Runtime 17.0.11, Kotlin 1.9.23, Gradle 7.4.2 and pl.droidsonroids.pitest version 0.2.18, and my current pitest configuration block is the following:

pitest {
    targetClasses=['app.*']
    targetTests=["app.domain.*"]
    avoidCallsTo=["kotlin.jvm.internal"]
    mutators=["STRONGER"]
    threads=Runtime.getRuntime().availableProcessors()
    outputFormats=["XML", "HTML"]
    mutationThreshold=70
    coverageThreshold=0
}

Thanks in advance for your answer!

@hcoles
Copy link
Owner

hcoles commented Jul 3, 2024

If you can provide a minimal self contained project that replicates the issue I can take a look.

@MonkeyMiguelS
Copy link
Author

It's not possible right now. Is there any other way we can try to solve this?

@hcoles
Copy link
Owner

hcoles commented Aug 12, 2024

@MonkeyMiguelS I'm not able to investigate without a minimal project that reproduces the issue.

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

2 participants