Merge pull request #71 from kemitix/pitest-mutation

Pitest mutation
This commit is contained in:
Paul Campbell 2017-05-30 21:26:13 +01:00 committed by GitHub
commit dd7ecf7da6
3 changed files with 81 additions and 2 deletions

View file

@ -38,6 +38,7 @@ desired value.
* huntbugs.version
* jacoco-maven-plugin.version
* highwheel-maven.version
* pitest.version
* maven-jxr-plugin.version
* jacoco-class-line-covered-ratio
* jacoco-class-instruction-covered-ratio
@ -197,7 +198,46 @@ classes.
### Configuration
The plugin will `analyse` the project during the `compile` phase.
The plugin will `analyse` the project during the `verify` phase.
## Pitest Plugin
The [Pitest Plugin](http://pitest.org/)
provides mutation testing for classes found in the generated `target`
directory.
### Configuration
The plugin with perform mutation tests during the `verify` phase.
By default, classed named `Immutable*`, will not be included.
(e.g. classes generated by `org.immutables:value`)
The following properties can adjust the default configuration.
#### `pitest.skip`
Default is `false`.
Set this to `true` to disable the **Pitest Plugin**.
#### `pitest.coverage`
Default is `0`%. (i.e. disabled)
Line coverage at which to fail build.
#### `pitest.mutation`
Default is `0`%. (i.e. disabled)
Mutation score threshold at which to fail build.
#### `pitest.failWhenNoMutations`
Default is `true`.
Set this to `false` to not fail build when there are no mutations.
## Digraph Dependency Plugin

39
pom.xml
View file

@ -60,12 +60,17 @@
<huntbugs.version>0.0.11</huntbugs.version>
<jacoco-maven-plugin.version>0.7.9</jacoco-maven-plugin.version>
<highwheel-maven.version>1.2</highwheel-maven.version>
<pitest.version>1.2.0</pitest.version>
<maven-jxr-plugin.version>2.5</maven-jxr-plugin.version>
<jacoco-class-line-covered-ratio>0.50</jacoco-class-line-covered-ratio>
<jacoco-class-instruction-covered-ratio>0.80</jacoco-class-instruction-covered-ratio>
<jacoco-class-missed-count-maximum>0</jacoco-class-missed-count-maximum>
<java.version>1.8</java.version>
<pitest.coverage>0</pitest.coverage>
<pitest.mutation>0</pitest.mutation>
<pitest.skip>false</pitest.skip>
<pitest.failWhenNoMutations>true</pitest.failWhenNoMutations>
</properties>
<developers>
@ -361,6 +366,28 @@
</execution>
</executions>
</plugin><!-- highwheel-maven -->
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>${pitest.version}</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>mutationCoverage</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>${pitest.skip}</skip>
<timestampedReports>false</timestampedReports>
<excludedClasses>*.Immutable*</excludedClasses>
<coverageThreshold>${pitest.coverage}</coverageThreshold>
<mutationThreshold>${pitest.mutation}</mutationThreshold>
<failWhenNoMutations>${pitest.failWhenNoMutations}</failWhenNoMutations>
</configuration>
</plugin><!-- pitest-maven -->
</plugins>
</build>
@ -390,6 +417,18 @@
<linkXRef>true</linkXRef>
</configuration>
</plugin><!-- maven-pmd-plugin -->
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>${pitest.version}</version>
<reportSets>
<reportSet>
<reports>
<report>report</report>
</reports>
</reportSet>
</reportSets>
</plugin><!-- pitest-maven -->
</plugins>
</reporting>

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then
if [ "$TRAVIS_BRANCH" = 'master' ]; then
echo "Preparing to deploy to nexus..."
openssl aes-256-cbc -K $encrypted_f424d6efdd6f_key -iv $encrypted_f424d6efdd6f_iv \
-in travis-ci/codesigning.asc.enc -out travis-ci/codesigning.asc -d