From 599d7e43aedf91990e7cf53318c45dfea933fa25 Mon Sep 17 00:00:00 2001 From: abaudet Date: Fri, 14 Jun 2019 16:50:25 +0400 Subject: [PATCH] chore(test) Add pitest for mutation testing - Add profiles to run mutation tests - Generate mutation reports for each module - TODO: mutation tests for Spring Boot modules fail - TODO: report aggregation doesn't work for now (see https://github.com/hcoles/pitest/issues/622 and https://github.com/hcoles/pitest/issues/621) - Add coverage report in codecov - TODO: run mutation tests in Travis or other CI tool for develop and master branches --- .externalToolBuilders/asciidoctor.launch | 5 +- .externalToolBuilders/compile sass.launch | 1 + ...launch => site [target][no-report].launch} | 4 +- .travis.yml | 1 + pom.xml | 163 +++++++++++++++++- reporting/pom.xml | 67 ++++++- src/site/site.xml | 8 +- 7 files changed, 236 insertions(+), 13 deletions(-) rename .externalToolBuilders/{site [target].launch => site [target][no-report].launch} (67%) diff --git a/.externalToolBuilders/asciidoctor.launch b/.externalToolBuilders/asciidoctor.launch index 57fb8f3242..44a1f8be7a 100644 --- a/.externalToolBuilders/asciidoctor.launch +++ b/.externalToolBuilders/asciidoctor.launch @@ -1,10 +1,11 @@ - + + - + diff --git a/.externalToolBuilders/compile sass.launch b/.externalToolBuilders/compile sass.launch index 09167ca136..b5eb54bf6b 100644 --- a/.externalToolBuilders/compile sass.launch +++ b/.externalToolBuilders/compile sass.launch @@ -1,6 +1,7 @@ + diff --git a/.externalToolBuilders/site [target].launch b/.externalToolBuilders/site [target][no-report].launch similarity index 67% rename from .externalToolBuilders/site [target].launch rename to .externalToolBuilders/site [target][no-report].launch index 217252139f..b5324402ff 100644 --- a/.externalToolBuilders/site [target].launch +++ b/.externalToolBuilders/site [target][no-report].launch @@ -1,10 +1,10 @@ - + - + diff --git a/.travis.yml b/.travis.yml index e4c46cc5c4..b386cdd4de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,6 +76,7 @@ script: - $HOME/classpath-tests/$TEST_FOLDER/./mvnw test -T 2.5C -f "$HOME/classpath-tests/$TEST_FOLDER/pom.xml" -Dmaven.test.redirectTestOutputToFile=true -fae -q -B #| grep -Ei '(error|exception|Tests run:)' after_success: - ./mvnw sonar:sonar -B | grep -Ei '(warn|error|ANALYSIS SUCCESSFUL)' + - bash <(curl -s https://codecov.io/bash) - ./mvnw deploy --settings .travis-settings.xml -DskipTests=true -B | grep -Ei '(Uploading|Downloading|Uploaded|Downloaded)' # TODO: after error -> grab logs and send it after_failure: diff --git a/pom.xml b/pom.xml index 383e1d50ff..2d0190ff97 100644 --- a/pom.xml +++ b/pom.xml @@ -73,12 +73,15 @@ false false + + ${project.basedir}/../target/site/pit-reports + ${project.basedir}/../target/coverage-reports/jacoco-it.exec ${project.basedir}/../target/coverage-reports/jacoco-ut.exec ${project.basedir}/../target/coverage-reports/jacoco-all.exec ${project.basedir}/../target/site/jacoco-aggregate - + ${project.build.directory}/surefire-reports,${project.build.directory}/failsafe-reports ${jacoco.ut.execution.data.file},${jacoco.it.execution.data.file} @@ -100,6 +103,8 @@ ${project.build.outputDirectory}/staging ${site.staging.dir}/v${docProjectVersion} cerulean + ${maven.site.skip} + ${maven.site.skip} 2.10 @@ -109,6 +114,9 @@ 0.8.4 2.22.2 2.22.2 + + 1.4.7 + 1.3.7 3.7 3.0.0 @@ -709,6 +717,7 @@ copy-resources + ${asciidoctor.skip} src/docs/resources @@ -724,6 +733,7 @@ copy-resources + ${asciidoctor.skip} target/generated-docs @@ -807,6 +817,7 @@ unpack + ${maven.site.skip} io.github.devacfr.maven.skins @@ -875,6 +886,7 @@ run + ${maven.site.skip} @@ -915,6 +927,7 @@ + ${sass.skip} @@ -1100,6 +1113,41 @@ + + + eu.stamp-project + pitmp-maven-plugin + ${pitmp-maven-plugin.version} + + + run-mutation-testing + site + + run + + + descartes + + ogham-spring-boot-autoconfigure + ogham-spring-boot-starter-all + ogham-spring-boot-starter-email + ogham-spring-boot-starter-sms + ogham-spring-boot-common-autoconfigure + + + HTML + XML + + true + + + + + + org.pitest + pitest-maven + ${pitest-maven.version} + @@ -1140,6 +1188,34 @@ report-integration + + + report-aggregate + + false + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + + + + summary + licenses + modules + team + scm + issue-management + dependencies + dependency-info + dependency-convergence + dependency-management + plugins + + @@ -1220,6 +1296,91 @@ 8 + + mutation-testing + + + + + eu.stamp-project + pitmp-maven-plugin + + + + + + + + + + + + + + + + + + + + + + + + mutation-testing-only + + true + true + true + true + false + false + false + true + true + + + + + + eu.stamp-project + pitmp-maven-plugin + + + + + + + + + + + + + + + + + + + + + + + + mutation-testing-aggregate-report-only + + true + true + true + true + false + false + false + true + true + + diff --git a/reporting/pom.xml b/reporting/pom.xml index 86ecb4a2e1..d7812aaeb7 100644 --- a/reporting/pom.xml +++ b/reporting/pom.xml @@ -177,19 +177,76 @@ - - fr/sii/ogham/test/classpath/** - *mvnwrapper-for-projects/** - - ${jacoco.report.path} + + + + + + org.pitest + pitest-maven + + + merge-pitest-reports + site + + report-aggregate + + + + + + + + + + + + + + + + mutation-testing + + + + org.pitest + pitest-maven + + + + + + mutation-testing-only + + + + org.pitest + pitest-maven + + + + + + mutation-testing-aggregate-report-only + + + + org.pitest + pitest-maven + + + + + + \ No newline at end of file diff --git a/src/site/site.xml b/src/site/site.xml index 1dae1a5d65..4328d3ff10 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -44,7 +44,7 @@ Main Download|Contribute Documentation - reports + Reports|Maven Reports - @@ -203,6 +202,9 @@ - + + + + \ No newline at end of file