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

Maven goal to fail build #68

Open
bbaudry opened this issue Jul 14, 2018 · 7 comments
Open

Maven goal to fail build #68

bbaudry opened this issue Jul 14, 2018 · 7 comments

Comments

@bbaudry
Copy link
Contributor

bbaudry commented Jul 14, 2018

There should be parameters fo fail build

@danzone
Copy link
Contributor

danzone commented Aug 3, 2018

Hi @bbaudry, this feature is addressed by @nicolabertazzo within issue #22. I guess this issue can be closed.

@monperrus
Copy link
Member

For the record, from duplicate #142

This would be similar what jacoco is doing to break the build based on coverage info, see https://www.jacoco.org/jacoco/trunk/doc/check-mojo.html
And its usage in Spoon: https://github.com/INRIA/spoon/pull/3641/files

@monperrus
Copy link
Member

How does this prioritize for you @oscarlvp?

@oscarlvp
Copy link
Member

@monperrus this is a feature that maybe should not be added to Descartes as a PIT plugin. It might better be implemented outside, for example in PitMP or a dedicated Maven plugin. At the moment I see no way to make the build fail from the code of the PIT plugin that works well for all build systems.
Of course, we can always throw an exception when we find a pseudo-tested method. But, the error the user will see might be misleading as the build will fail almost in the same way as if there was a bug inside Descartes.
On the other hand, implementing this feature is a one-liner in any CI server using a tool like jq. It is just a matter of inspecting the JSON from the report.
Anyways, it would be really nice if you have a suggestion on how to achieve this keeping Descartes agnostic to the build system.

@monperrus
Copy link
Member

Hi Oscar,

I understand your point, it's not the responsibility of Descartes, it's the responsibility of the mutation testing driver PIT or PitMP.

It seems that PIT supports this:

What's your opinion on having this working with Descartes in conjunction?

@oscarlvp
Copy link
Member

This is the simplest option. However, it works with the number of mutants, and not with the method classification. You may not have any pseudo-tested methods but still have live mutants in partially-tested methods. But if that suites your goal, then it is the simplest solution.
This issue was opened with the idea of having something similar but using the method classification instead of the raw number of mutants.
See that this feature is actually implemented in PitMP but we need to update it.

@monperrus
Copy link
Member

You may not have any pseudo-tested methods but still have live mutants in partially-tested methods. But if that suites your goal, then it is the simplest solution.

Let's try this first in Spoon an see how it works and scales. Then we'll refine. Would you write a wrap-up on what configuration to write to do this (Descartes line threshold + Pit break the build)? Thanks!

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

4 participants