Skip mutation (pitest) testing via Jenkins job

675 views
Skip to first unread message

Nate Ruggieri

unread,
Oct 30, 2016, 3:28:03 PM10/30/16
to PIT Users
Hello,

I'm trying to configure a Jenkins job to skip mutation testing.  How can I accomplish this?  I know there is a way to set it in the pom but I need to have a way to do it via a Jenkins job.  This job is used to execute things for all kinds of projects so setting this in the POM of an individual module is not an option.  Also, the configuration of pitest is in a parent POM that cannot be set to skip mutation testing b/c it is needed in the majority of cases.  Basically, for this one particular Jenkins job I want to always skip PIT testing.

Thanks.

Stefan

unread,
Oct 31, 2016, 11:55:03 AM10/31/16
to pitu...@googlegroups.com

Hi Nate,


there are several things you can do with maven:

1. I'm wondering whether you'll always execute pitest in your build. I usually configure pitest to be executed by activating a profile or by running the pitest goal explicitly. Usually I don't want to execute pitest on each and every "mvn clean install". If you omit the pitest goal pitest won't run.

2. You can define a maven property for the skip option (in your parent pom) and overwrite it's value in your jenkins job:

<properties>

  <pitest.excection.skip>false</pitest.execution.skip> <!-- dont skip when property ommited -->

</properties>

.....

<build>

....

    <groupId>org.pitest</groupId>
    <artifactId>pitest-maven</artifactId>
    <configuration>

        <skip>${pitest.exection.skip}</skip>

......

    </configuration>

......

</build>

If you call your jenkins job with -Dpitest.exection.skip=true execution should be skipped.


I hope that helps,

Regards

Stefan

--
You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pitusers+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nate Ruggieri

unread,
Nov 2, 2016, 9:51:29 AM11/2/16
to pitu...@googlegroups.com
Thank you, Stefan.  This was very helpful and helped me to resolve my issue.

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/DSNPG9OQRf8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pitusers+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages