12. Assignments¶
12.1. Jenkins¶
Repository
https://github.com/AstroTech/ecosystem-example-java
Run SonarScanner analysis in Jenkins
Use official Docker images:
Jenkins
jenkinsci/blueocean
SonarQube:
sonarqube:latest
SonarScanner:
sonarsource/sonar-scanner-cli:latest
- Solution
Dockerfile
_solution/Dockerfile
Sonar-Project.properties
_solution/sonar-project.properties
Jenkinsfile (inline)
_solution/Jenkinsfile.inline
Jenkinsfile (env)
_solution/Dockerfile
12.2. Pitest¶
Repository
https://github.com/AstroTech/ecosystem-example-java
Install
openjdk-8-jdk
andmaven
Set Java 8 as default
update-alternatives --config java
Add
jUnit
as a project dependency inpom.xml
Install Pitest as a plugin in
pom.xml
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.5.2</version>
</plugin>
mvn compile
# Unit Tests
mvn test
# Integration tests
mvn verify
# Mutation Tests
mvn org.pitest:pitest-maven:mutationCoverage