diff --git a/ci-templates/jvm-build-steps.yaml b/ci-templates/jvm-build-steps.yaml index 82913a700..80c70c7e6 100644 --- a/ci-templates/jvm-build-steps.yaml +++ b/ci-templates/jvm-build-steps.yaml @@ -1,5 +1,6 @@ parameters: jdk: 1.8 + extra: steps: - task: CacheBeta@0 #we know the very first job will have restored or created this, so this will never write built artifacts to the cache diff --git a/ci-templates/stages.yml b/ci-templates/stages.yml index 4f37c5c9d..8dc72483c 100644 --- a/ci-templates/stages.yml +++ b/ci-templates/stages.yml @@ -95,10 +95,27 @@ stages: steps: - template: jvm-build-steps.yaml parameters: - # we only generate the PDF documentation once for the initial JDK 8 build - extra: '-Ddocumentation-pdf' + # we only generate the PDF documentation and test coverage once for the initial JDK 8 build + extra: '-Ddocumentation-pdf -Ptest-coverage' - publish: $(MAVEN_CACHE_FOLDER) artifact: $(Build.SourceVersion)-BuiltMavenRepo + + - task: Maven@3 + displayName: 'Aggregate Code Coverage' + inputs: + mavenPomFile: 'coverage-report/pom.xml' + goals: 'install' + mavenOptions: $(MAVEN_OPTS) + options: '-B --settings azure-mvn-settings.xml -Dno-native -Dno-format' + + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: 'JaCoCo' + summaryFileLocation: 'coverage-report/target/site/jacoco/jacoco.xml' + pathToSources: 'coverage-report/src/main/java' + reportDirectory: 'coverage-report/target/site/jacoco/' + failIfCoverageEmpty: true + - template: prepare-cache.yaml - stage: run_jvm_tests_stage${{parameters.expectUseVMs}} diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml index 074a7b808..5b4a780f7 100644 --- a/coverage-report/pom.xml +++ b/coverage-report/pom.xml @@ -35,7 +35,7 @@ - prepare.sh + ${project.basedir}/prepare.sh ${project.basedir} @@ -61,13 +61,6 @@ - - compile-report - test - - report - - diff --git a/coverage-report/prepare.sh b/coverage-report/prepare.sh index c3f211394..504693b8d 100755 --- a/coverage-report/prepare.sh +++ b/coverage-report/prepare.sh @@ -5,14 +5,24 @@ mkdir -p src/main/java for j in '../extensions' '../core' '../devtools' '../independent-projects/' do - for i in `find $j -regex .*target/classes ` + for i in `find $j -regex .*target/classes` do cp -r $i/* target/classes/ done - for i in `find $j -regex .*src/main/java ` + for i in `find $j -regex .*src/main/java` do cp -r $i/* src/main/java/ done done -#needed to make sure the script always suceeds + +#we don't care about classes in the 'graal' package, because they are only used in native image generation +find target/classes/ -name graal -exec rm -r {} \; + +#antlr generated code +rm -r target/classes/io/quarkus/panacheql/internal + +#we don't care about the document processor +rm -r target/classes/io/quarkus/annotation/processor/generate_doc + +#needed to make sure the script always succeeds echo "complete" diff --git a/pom.xml b/pom.xml index 00ff31b7e..db481b85f 100644 --- a/pom.xml +++ b/pom.xml @@ -159,137 +159,6 @@ - - - jacoco - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - jacoco-prepare - - prepare-agent - - - ${project.build.directory}/jacoco.exec - - * - - - io.quarkus.it.* - - - - - jacoco-report-per-module - test - - report - - - ${project.build.directory}/jacoco.exec - - - - - - - - - jacoco-report - - - - org.apache.maven.plugins - maven-dependency-plugin - - - - copy - - process-test-resources - false - - - - org.jacoco - org.jacoco.ant - ${jacoco.version} - - - true - ${project.build.directory}/jacoco-jars - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - org.jacoco - org.jacoco.ant - ${jacoco.version} - - - - - jacoco-all-in-one-report - post-integration-test - - run - - false - - - - - - Creating JaCoCo for Quarkus code coverage reports - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tcks