This repository contains a sonar plugin to report on Stryker, the JavaScript mutation testing framework.
As of now the sonar-stryker-plugin is not distributed via any artifact repository. However, it can be installed manually:
- Make sure you have git and maven installed locally. Make sure you have a running sonar qube server (or installed locally).
- Clone this repository
git clone [email protected]:stryker-mutator/sonar-stryker-plugin.git
- Package the sonar plugin
cd sonar-stryker-plugin mvn package
- Copy the
target/stryker-sonar-plugin.jar
to the downloads folder of your sonar qube instance (for example:/sonarqube-6.2/extensions/downloads
) - Restart sonar qube
- Log on to the sonar qube web interface, go to 'rules'. Two new rules should be present under language "JavaScript". Enable these rules for the profile of choice:
- Mutant not covered
- Mutant survived
Next, setup Stryker in your project. See stryker-mutator.github.io. Make sure to enable the 'event-recorder'
reporter.
This will record all reporter events and write them to disk (reports/mutation/events
by default).
Make sure that works before proceeding.
Run sonar in your projects folder. This can be done in a number of ways:
- Using the sonar-scanner
- Using the sonar-maven-plugin
- (Other sonar plugins not further explained here)
Make sure you configure the sonar.sources
correctly. This should point to the root directory of your source files.
For example (using the sonar-scanner
):
# sonar-project.properties
sonar.sources=src
Or (using the sonar-maven-plugin
)
<!-- pom.xml -->
<properties>
<sonar.sources>src</sonar.sources>
</properties>