A PIT reporter that publishes your mutation testing results to the Stryker Mutator Dashboard.
Setup is relatively easy:
- make sure there is an environment variable
STRYKER_DASHBOARD_API_KEY
with the API key that you got when you set up your project
The reporter will autoconfigure itself, given you work in any of the following environments:
- GitHub Actions
If your builds run in another environment, please feel free to open an issue.
When uploading the report fails, this reporter will make the whole build fail.
If this happens and you want to open an issue, please make sure to run again with the verbose
switch for PIT.
Note that this will also log the last three characters of your Stryker Dashboard API key.
- Find the place in your pom.xml where you define the pitest-maven plugin.
- Add a dependency to this plugin declaration:
<dependency> <groupId>it.mulders.stryker</groupId> <artifactId>pit-dashboard-reporter</artifactId> <version>0.2.1</version> </dependency>
- Configure PIT to use the new output format:
<configuration> <outputFormats> <format>stryker-dashboard</format> </outputFormats> </configuration>
- Alternatively, if
<configuration>
is already there, add the<outputFormats>
. - Similarly, if
<outputFormats>
is already there, add (or replace) with<format>stryker-dashboard</format>
.
- Alternatively, if
- Important If you are working on a multi-module Maven project, add the following to the
<configuration>
block:This will ensure the mutation testing results of the various Maven modules will not mix up in the report. You should not do this if you have a single-module Maven project!<pluginConfiguration> <stryker.moduleName>${project.artifactId}</stryker.moduleName> </pluginConfiguration>
- Find the place in your build.gradle where you declare your dependencies.
- Add a dependency to this plugin declaration:
pitest it.mulders.stryker:pit-dashboard-reporter:0.2.1
- Configure PIT to use the new output format:
apply plugin: 'info.solidsoft.pitest' pitest { outputFormats = ['stryker-dashboard'] }
- Alternatively, if
pitest
is already there, add theoutputFormats
line - Similarly, if
outputFormats
is already there, append the existing array.
- Alternatively, if
- Important If you are working on a multi-module Gradle project, add the following to the
pitest
block for each subproject: Make sure to do this inside asubprojects
block, like so:This will ensure the mutation testing results of the various Gradle modules will not mix up in the report. You should not do this if you have a single-module Gradle project!subprojects { // apply plugin: 'info.solidsoft.pitest' pluginManager.withPlugin('info.solidsoft.pitest') { pluginConfiguration = [ "stryker.moduleName": project.name ] } }
In the table below you will find which version of this reporter you can use for a given version of Pitest.
Pitest version | Reporter version |
---|---|
1.14.0 and lower | v0.1.5 |
1.14.0 and up | v0.2.1 or higher |
This project is licensed under the MIT license. See the LICENSE file for the full text of the license.
Credit where credit is due: this reporter would not exist without the tremendous work of by Wouter Aarts. His reporter contains all the complex mapping from PIT results to mutation-testing-elements' JSON format.