Error "Mutation testing requires a green suite"

1,670 views
Skip to first unread message

Viswanath R

unread,
Nov 4, 2014, 10:21:48 AM11/4/14
to pitu...@googlegroups.com, viswa...@nsn.com
We have added pitest plugin to our project. We are using maven for build. When building the project with pitest plugin we are getting the following error

[ERROR] Failed to execute goal org.pitest:pitest-maven:1.1.1:mutationCoverage (mutation-report) on project: Execution mutation-report of goal org.pitest:pitest-maven:1.1.1:mutationCoverage failed: All tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite.
[ERROR] See http://pitest.org for more details.

We need the mutation coverage report even when the tests fail without mutation (without green build) and not sure of the way for getting the report generated. Also we don't want pitest to break the build even in case of any coverage issues.

Any help is greatly appreciated. Thanks in advance.

Regards,
Viswanath


Henry Coles

unread,
Nov 4, 2014, 11:01:08 AM11/4/14
to pitu...@googlegroups.com
On 4 November 2014 15:21, Viswanath R <viswan...@gmail.com> wrote:


We need the mutation coverage report even when the tests fail without mutation (without green build) and not sure of the way for getting the report generated. Also we don't want pitest to break the build even in case of any coverage issues.


Pitest doesn't currently support running without a green suite. Supporting this isn't as simple as continuing running - a failing test would appear to kill all mutants unless it could be automatically filtered out.

If the build runs green without pitest I'd suggest checking the log to see which tests are failing in the coverage stage. As pitest doesn't integrate with surefire common problems include :-

1) Tests being picked up by pitest that are excluded when running via surefire
2) Tests relying on environment variables etc setup in the surefire config but not the pitest config
3) Hidden order dependencies in tests revealed if the order pitest runs the tests in differs from surefire

Although pitest works pretty well with most of the java ecosystem, if you have any unusual junit runners in your codebase these can also sometimes cause a problem.

Henry

Viswanath R

unread,
Nov 4, 2014, 11:35:52 AM11/4/14
to pitu...@googlegroups.com

We have our junit running successful. I will debug the issue based on your suggestions.

Thanks for your early response.

--
You received this message because you are subscribed to a topic in the Google Groups "PIT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pitusers/wRkMbebVSsg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pitusers+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages