From d42fa6e12a60823c09e4a095c8677c15bf0b43ef Mon Sep 17 00:00:00 2001 From: Marty30 Date: Tue, 27 Jun 2017 22:25:40 +0200 Subject: [PATCH 1/2] Added mutation testing --- .travis.yml | 3 ++- pom.xml | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a9d5117be..3423bef64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,8 @@ before_script: - docker-compose up -d script: - - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Dskip.failsafe.tests sonar:sonar + - mvn org.pitest:pitest-maven:mutationCoverage + - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test -Dskip.failsafe.tests sonar:sonar -Dsonar.pitest.mode=reuseReport - docker exec springpetclinic_pet-clinic_1 mvn verify -Dskip.surefire.tests -q --batch-mode after_script: diff --git a/pom.xml b/pom.xml index e7a215877..c0f1dc7a1 100644 --- a/pom.xml +++ b/pom.xml @@ -156,6 +156,16 @@ + + org.pitest + pitest-maven + 1.2.0 + + + XML + + + org.springframework.boot spring-boot-maven-plugin From 799eaf36b64758815f11a9b9de477381a7644382 Mon Sep 17 00:00:00 2001 From: Marty30 Date: Tue, 27 Jun 2017 22:39:57 +0200 Subject: [PATCH 2/2] Move mutation testing to the build phase --- .travis.yml | 1 - Dockerfile | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3423bef64..351fd2b0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,6 @@ before_script: - docker-compose up -d script: - - mvn org.pitest:pitest-maven:mutationCoverage - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test -Dskip.failsafe.tests sonar:sonar -Dsonar.pitest.mode=reuseReport - docker exec springpetclinic_pet-clinic_1 mvn verify -Dskip.surefire.tests -q --batch-mode diff --git a/Dockerfile b/Dockerfile index 68dfff9fe..1f2d91493 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,8 @@ WORKDIR /app COPY . . # Build the project -RUN mvn package -Dskip.failsafe.tests -q --batch-mode +RUN mvn package -Dskip.failsafe.tests -q --batch-mode && \ +mvn org.pitest:pitest-maven:mutationCoverage -q --batch-mode # Copy and make the jar executable RUN sh -c 'mkdir dist/ && cp -a target/. dist/ && touch dist/spring-petclinic-*.jar'