From 6ded652daebacda25688913940ba7fda166470e8 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 20 Oct 2016 09:31:00 -0700 Subject: [PATCH 1/8] Tweaking jacoco includes/excludes --- Jenkinsfile | 1 - pom.xml | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7f74c792d56..b45d3fb5216 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -56,7 +56,6 @@ node('linux') { testResults: '**/target/surefire-reports/TEST-*.xml']) // Collect up the jacoco execution results step([$class: 'JacocoPublisher', - inclusionPattern: "**/org/eclipse/jetty/**/*.class", execPattern: '**/target/jacoco.exec', classPattern: '**/target/classes', sourcePattern: '**/src/main/java']) diff --git a/pom.xml b/pom.xml index d0fb1e0fb72..af538cc0d79 100644 --- a/pom.xml +++ b/pom.xml @@ -175,6 +175,26 @@ org.jacoco jacoco-maven-plugin 0.7.7.201606060606 + + + **/org/eclipse/jetty/**/*.class + + + + **/org/eclipse/jetty/ant/** + **/org/eclipse/jetty/maven/** + **/org/eclipse/jetty/jspc/** + + **/org/eclipse/jetty/gcloud/** + **/org/eclipse/jetty/infinispan/** + **/org/eclipse/jetty/osgi/** + **/org/eclipse/jetty/spring/** + **/org/eclipse/jetty/http/spi/** + + **/org/eclipse/jetty/tests/** + **/org/eclipse/jetty/test/** + + jacoco-initialize From d4abbb049969b33e24292f4d2add434eed068ff2 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 20 Oct 2016 10:03:18 -0700 Subject: [PATCH 2/8] Correcting Jenkinsfile warning + Using the 'stage' step without a block argument is deprecated --- Jenkinsfile | 72 ++++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b45d3fb5216..d448ec83db5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,8 +11,9 @@ node('linux') { try { - stage 'Checkout' - checkout scm + stage('Checkout') { + checkout scm + } } catch (Exception e) { notifyBuild("Checkout Failure") throw e @@ -20,10 +21,11 @@ node('linux') { try { - stage 'Compile' - withEnv(mvnEnv) { - timeout(time: 15, unit: 'MINUTES') { - sh "mvn -B clean install -Dtest=None" + stage('Compile') { + withEnv(mvnEnv) { + timeout(time: 15, unit: 'MINUTES') { + sh "mvn -B clean install -Dtest=None" + } } } } catch(Exception e) { @@ -33,10 +35,11 @@ node('linux') { try { - stage 'Javadoc' - withEnv(mvnEnv) { - timeout(time: 15, unit: 'MINUTES') { - sh "mvn -B javadoc:javadoc" + stage('Javadoc') { + withEnv(mvnEnv) { + timeout(time: 15, unit: 'MINUTES') { + sh "mvn -B javadoc:javadoc" + } } } } catch(Exception e) { @@ -46,30 +49,31 @@ node('linux') { try { - stage 'Test' - withEnv(mvnEnv) { - timeout(time: 60, unit: 'MINUTES') { - // Run test phase / ignore test failures - sh "mvn -B install -Dmaven.test.failure.ignore=true" - // Report failures in the jenkins UI - step([$class: 'JUnitResultArchiver', - testResults: '**/target/surefire-reports/TEST-*.xml']) - // Collect up the jacoco execution results - step([$class: 'JacocoPublisher', - execPattern: '**/target/jacoco.exec', - classPattern: '**/target/classes', - sourcePattern: '**/src/main/java']) - // Report on Maven and Javadoc warnings - step([$class: 'WarningsPublisher', - consoleParsers: [ - [parserName: 'Maven'], - [parserName: 'JavaDoc'], - [parserName: 'JavaC'] - ]]) - } - if(isUnstable()) - { - notifyBuild("Unstable / Test Errors") + stage('Test') { + withEnv(mvnEnv) { + timeout(time: 60, unit: 'MINUTES') { + // Run test phase / ignore test failures + sh "mvn -B install -Dmaven.test.failure.ignore=true" + // Report failures in the jenkins UI + step([$class: 'JUnitResultArchiver', + testResults: '**/target/surefire-reports/TEST-*.xml']) + // Collect up the jacoco execution results + step([$class: 'JacocoPublisher', + execPattern: '**/target/jacoco.exec', + classPattern: '**/target/classes', + sourcePattern: '**/src/main/java']) + // Report on Maven and Javadoc warnings + step([$class: 'WarningsPublisher', + consoleParsers: [ + [parserName: 'Maven'], + [parserName: 'JavaDoc'], + [parserName: 'JavaC'] + ]]) + } + if(isUnstable()) + { + notifyBuild("Unstable / Test Errors") + } } } } catch(Exception e) { From 09abf0b4bdaa9664a798c95dff47ec404eb7600f Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 20 Oct 2016 11:09:24 -0700 Subject: [PATCH 3/8] Revert "Correcting Jenkinsfile warning" This reverts commit d4abbb049969b33e24292f4d2add434eed068ff2. --- Jenkinsfile | 72 +++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 38 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d448ec83db5..b45d3fb5216 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,9 +11,8 @@ node('linux') { try { - stage('Checkout') { - checkout scm - } + stage 'Checkout' + checkout scm } catch (Exception e) { notifyBuild("Checkout Failure") throw e @@ -21,11 +20,10 @@ node('linux') { try { - stage('Compile') { - withEnv(mvnEnv) { - timeout(time: 15, unit: 'MINUTES') { - sh "mvn -B clean install -Dtest=None" - } + stage 'Compile' + withEnv(mvnEnv) { + timeout(time: 15, unit: 'MINUTES') { + sh "mvn -B clean install -Dtest=None" } } } catch(Exception e) { @@ -35,11 +33,10 @@ node('linux') { try { - stage('Javadoc') { - withEnv(mvnEnv) { - timeout(time: 15, unit: 'MINUTES') { - sh "mvn -B javadoc:javadoc" - } + stage 'Javadoc' + withEnv(mvnEnv) { + timeout(time: 15, unit: 'MINUTES') { + sh "mvn -B javadoc:javadoc" } } } catch(Exception e) { @@ -49,31 +46,30 @@ node('linux') { try { - stage('Test') { - withEnv(mvnEnv) { - timeout(time: 60, unit: 'MINUTES') { - // Run test phase / ignore test failures - sh "mvn -B install -Dmaven.test.failure.ignore=true" - // Report failures in the jenkins UI - step([$class: 'JUnitResultArchiver', - testResults: '**/target/surefire-reports/TEST-*.xml']) - // Collect up the jacoco execution results - step([$class: 'JacocoPublisher', - execPattern: '**/target/jacoco.exec', - classPattern: '**/target/classes', - sourcePattern: '**/src/main/java']) - // Report on Maven and Javadoc warnings - step([$class: 'WarningsPublisher', - consoleParsers: [ - [parserName: 'Maven'], - [parserName: 'JavaDoc'], - [parserName: 'JavaC'] - ]]) - } - if(isUnstable()) - { - notifyBuild("Unstable / Test Errors") - } + stage 'Test' + withEnv(mvnEnv) { + timeout(time: 60, unit: 'MINUTES') { + // Run test phase / ignore test failures + sh "mvn -B install -Dmaven.test.failure.ignore=true" + // Report failures in the jenkins UI + step([$class: 'JUnitResultArchiver', + testResults: '**/target/surefire-reports/TEST-*.xml']) + // Collect up the jacoco execution results + step([$class: 'JacocoPublisher', + execPattern: '**/target/jacoco.exec', + classPattern: '**/target/classes', + sourcePattern: '**/src/main/java']) + // Report on Maven and Javadoc warnings + step([$class: 'WarningsPublisher', + consoleParsers: [ + [parserName: 'Maven'], + [parserName: 'JavaDoc'], + [parserName: 'JavaC'] + ]]) + } + if(isUnstable()) + { + notifyBuild("Unstable / Test Errors") } } } catch(Exception e) { From b8127399d795a36723beb0da98aafa51eae4e9f1 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 20 Oct 2016 11:28:26 -0700 Subject: [PATCH 4/8] Tweaking jacoco includes/excludes in pom.xml --- pom.xml | 55 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index af538cc0d79..c599ddebf4c 100644 --- a/pom.xml +++ b/pom.xml @@ -175,26 +175,6 @@ org.jacoco jacoco-maven-plugin 0.7.7.201606060606 - - - **/org/eclipse/jetty/**/*.class - - - - **/org/eclipse/jetty/ant/** - **/org/eclipse/jetty/maven/** - **/org/eclipse/jetty/jspc/** - - **/org/eclipse/jetty/gcloud/** - **/org/eclipse/jetty/infinispan/** - **/org/eclipse/jetty/osgi/** - **/org/eclipse/jetty/spring/** - **/org/eclipse/jetty/http/spi/** - - **/org/eclipse/jetty/tests/** - **/org/eclipse/jetty/test/** - - jacoco-initialize @@ -202,6 +182,31 @@ prepare-agent + + + + + **/org/eclipse/jetty/ant/** + **/org/eclipse/jetty/maven/** + **/org/eclipse/jetty/jspc/** + + **/org/eclipse/jetty/gcloud/** + **/org/eclipse/jetty/infinispan/** + **/org/eclipse/jetty/osgi/** + **/org/eclipse/jetty/spring/** + **/org/eclipse/jetty/http/spi/** + + **/org/eclipse/jetty/tests/** + **/org/eclipse/jetty/test/** + + jacoco-site @@ -209,6 +214,16 @@ report + + + + **/org/eclipse/jetty/** + + From bb0ac6232852257acb19a6e7a9700ec35c44c0ff Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 20 Oct 2016 11:29:24 -0700 Subject: [PATCH 5/8] Correcting for Jenkinsfile "stage" syntax warning The Warning Message: "Using the 'stage' step without a block argument is deprecated" --- Jenkinsfile | 72 ++++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b45d3fb5216..d448ec83db5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,8 +11,9 @@ node('linux') { try { - stage 'Checkout' - checkout scm + stage('Checkout') { + checkout scm + } } catch (Exception e) { notifyBuild("Checkout Failure") throw e @@ -20,10 +21,11 @@ node('linux') { try { - stage 'Compile' - withEnv(mvnEnv) { - timeout(time: 15, unit: 'MINUTES') { - sh "mvn -B clean install -Dtest=None" + stage('Compile') { + withEnv(mvnEnv) { + timeout(time: 15, unit: 'MINUTES') { + sh "mvn -B clean install -Dtest=None" + } } } } catch(Exception e) { @@ -33,10 +35,11 @@ node('linux') { try { - stage 'Javadoc' - withEnv(mvnEnv) { - timeout(time: 15, unit: 'MINUTES') { - sh "mvn -B javadoc:javadoc" + stage('Javadoc') { + withEnv(mvnEnv) { + timeout(time: 15, unit: 'MINUTES') { + sh "mvn -B javadoc:javadoc" + } } } } catch(Exception e) { @@ -46,30 +49,31 @@ node('linux') { try { - stage 'Test' - withEnv(mvnEnv) { - timeout(time: 60, unit: 'MINUTES') { - // Run test phase / ignore test failures - sh "mvn -B install -Dmaven.test.failure.ignore=true" - // Report failures in the jenkins UI - step([$class: 'JUnitResultArchiver', - testResults: '**/target/surefire-reports/TEST-*.xml']) - // Collect up the jacoco execution results - step([$class: 'JacocoPublisher', - execPattern: '**/target/jacoco.exec', - classPattern: '**/target/classes', - sourcePattern: '**/src/main/java']) - // Report on Maven and Javadoc warnings - step([$class: 'WarningsPublisher', - consoleParsers: [ - [parserName: 'Maven'], - [parserName: 'JavaDoc'], - [parserName: 'JavaC'] - ]]) - } - if(isUnstable()) - { - notifyBuild("Unstable / Test Errors") + stage('Test') { + withEnv(mvnEnv) { + timeout(time: 60, unit: 'MINUTES') { + // Run test phase / ignore test failures + sh "mvn -B install -Dmaven.test.failure.ignore=true" + // Report failures in the jenkins UI + step([$class: 'JUnitResultArchiver', + testResults: '**/target/surefire-reports/TEST-*.xml']) + // Collect up the jacoco execution results + step([$class: 'JacocoPublisher', + execPattern: '**/target/jacoco.exec', + classPattern: '**/target/classes', + sourcePattern: '**/src/main/java']) + // Report on Maven and Javadoc warnings + step([$class: 'WarningsPublisher', + consoleParsers: [ + [parserName: 'Maven'], + [parserName: 'JavaDoc'], + [parserName: 'JavaC'] + ]]) + } + if(isUnstable()) + { + notifyBuild("Unstable / Test Errors") + } } } } catch(Exception e) { From a733d2768c8ddc8cda7b29e2b73b1e60aa6e9209 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 20 Oct 2016 12:39:47 -0700 Subject: [PATCH 6/8] Setting jacoco jenkins publisher to report only on org.eclipse.jetty.* --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index d448ec83db5..bb6fd7d2272 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,6 +59,7 @@ node('linux') { testResults: '**/target/surefire-reports/TEST-*.xml']) // Collect up the jacoco execution results step([$class: 'JacocoPublisher', + inclusionPattern: '**/org/eclipse/jetty/**/*.class', execPattern: '**/target/jacoco.exec', classPattern: '**/target/classes', sourcePattern: '**/src/main/java']) From 2d650512bf2db785d80442498b07b28a11885af2 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 20 Oct 2016 12:48:32 -0700 Subject: [PATCH 7/8] Skipping jacoco collection on build/test/support/integration modules --- apache-jsp/pom.xml | 7 +++++++ apache-jstl/pom.xml | 7 +++++++ jetty-ant/pom.xml | 7 +++++++ jetty-http-spi/pom.xml | 7 +++++++ jetty-jspc-maven-plugin/pom.xml | 7 +++++++ jetty-maven-plugin/pom.xml | 7 +++++++ jetty-osgi/pom.xml | 7 +++++++ jetty-spring/pom.xml | 7 +++++++ pom.xml | 25 ------------------------- tests/test-webapps/pom.xml | 7 +++++++ 10 files changed, 63 insertions(+), 25 deletions(-) diff --git a/apache-jsp/pom.xml b/apache-jsp/pom.xml index f327831f240..16b6fbae64e 100644 --- a/apache-jsp/pom.xml +++ b/apache-jsp/pom.xml @@ -78,6 +78,13 @@ + + org.jacoco + jacoco-maven-plugin + + true + + diff --git a/apache-jstl/pom.xml b/apache-jstl/pom.xml index 54d154ca131..1f152a3c0e7 100644 --- a/apache-jstl/pom.xml +++ b/apache-jstl/pom.xml @@ -29,6 +29,13 @@ + + org.jacoco + jacoco-maven-plugin + + true + + diff --git a/jetty-ant/pom.xml b/jetty-ant/pom.xml index aa0899f4e79..ad32b9789bb 100644 --- a/jetty-ant/pom.xml +++ b/jetty-ant/pom.xml @@ -30,6 +30,13 @@ + + org.jacoco + jacoco-maven-plugin + + true + + diff --git a/jetty-http-spi/pom.xml b/jetty-http-spi/pom.xml index e021136c1b4..0005157d09f 100644 --- a/jetty-http-spi/pom.xml +++ b/jetty-http-spi/pom.xml @@ -68,6 +68,13 @@ org.eclipse.jetty.http.spi.* + + org.jacoco + jacoco-maven-plugin + + true + + diff --git a/jetty-jspc-maven-plugin/pom.xml b/jetty-jspc-maven-plugin/pom.xml index 534ee361123..f97d8d2e603 100644 --- a/jetty-jspc-maven-plugin/pom.xml +++ b/jetty-jspc-maven-plugin/pom.xml @@ -32,6 +32,13 @@ + + org.jacoco + jacoco-maven-plugin + + true + + diff --git a/jetty-maven-plugin/pom.xml b/jetty-maven-plugin/pom.xml index cd07ff70406..d63f4559980 100644 --- a/jetty-maven-plugin/pom.xml +++ b/jetty-maven-plugin/pom.xml @@ -35,6 +35,13 @@ + + org.jacoco + jacoco-maven-plugin + + true + + diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml index 74c8661d0ce..b89016e727e 100644 --- a/jetty-osgi/pom.xml +++ b/jetty-osgi/pom.xml @@ -82,6 +82,13 @@ + + org.jacoco + jacoco-maven-plugin + + true + + diff --git a/jetty-spring/pom.xml b/jetty-spring/pom.xml index 2f25b999117..8bd8e39bcd2 100644 --- a/jetty-spring/pom.xml +++ b/jetty-spring/pom.xml @@ -33,6 +33,13 @@ + + org.jacoco + jacoco-maven-plugin + + true + + diff --git a/pom.xml b/pom.xml index c599ddebf4c..d22ed42d7c6 100644 --- a/pom.xml +++ b/pom.xml @@ -182,31 +182,6 @@ prepare-agent - - - - - **/org/eclipse/jetty/ant/** - **/org/eclipse/jetty/maven/** - **/org/eclipse/jetty/jspc/** - - **/org/eclipse/jetty/gcloud/** - **/org/eclipse/jetty/infinispan/** - **/org/eclipse/jetty/osgi/** - **/org/eclipse/jetty/spring/** - **/org/eclipse/jetty/http/spi/** - - **/org/eclipse/jetty/tests/** - **/org/eclipse/jetty/test/** - - jacoco-site diff --git a/tests/test-webapps/pom.xml b/tests/test-webapps/pom.xml index e22433328b5..df2ee6ee2d6 100644 --- a/tests/test-webapps/pom.xml +++ b/tests/test-webapps/pom.xml @@ -38,6 +38,13 @@ true + + org.jacoco + jacoco-maven-plugin + + true + + From 3bfc9148892c0dc3ff29ce8f17f69b7a1dcd59f2 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 20 Oct 2016 14:14:50 -0700 Subject: [PATCH 8/8] More attempts at jacoco exclusions --- Jenkinsfile | 19 +++++++++++++++++++ pom.xml | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index bb6fd7d2272..7fbe3fcba87 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -58,8 +58,27 @@ node('linux') { step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml']) // Collect up the jacoco execution results + def jacocoExcludes = + // build tools + "**/org/eclipse/jetty/ant/**" + + ",**/org/eclipse/jetty/maven/**" + + ",**/org/eclipse/jetty/jspc/**" + + // example code / documentation + ",**/org/eclipse/jetty/embedded/**" + + ",**/org/eclipse/jetty/asyncrest/**" + + ",**/org/eclipse/jetty/demo/**" + + // special environments / late integrations + ",**/org/eclipse/jetty/gcloud/**" + + ",**/org/eclipse/jetty/infinispan/**" + + ",**/org/eclipse/jetty/osgi/**" + + ",**/org/eclipse/jetty/spring/**" + + ",**/org/eclipse/jetty/http/spi/**" + + // test classes + ",**/org/eclipse/jetty/tests/**" + + ",**/org/eclipse/jetty/test/**"; step([$class: 'JacocoPublisher', inclusionPattern: '**/org/eclipse/jetty/**/*.class', + exclusionPattern: jacocoExcludes, execPattern: '**/target/jacoco.exec', classPattern: '**/target/classes', sourcePattern: '**/src/main/java']) diff --git a/pom.xml b/pom.xml index d22ed42d7c6..60b2858ee0c 100644 --- a/pom.xml +++ b/pom.xml @@ -175,6 +175,27 @@ org.jacoco jacoco-maven-plugin 0.7.7.201606060606 + + + + **/org/eclipse/jetty/ant/** + **/org/eclipse/jetty/maven/** + **/org/eclipse/jetty/jspc/** + + **/org/eclipse/jetty/embedded/** + **/org/eclipse/jetty/asyncrest/** + **/org/eclipse/jetty/demo/** + + **/org/eclipse/jetty/gcloud/** + **/org/eclipse/jetty/infinispan/** + **/org/eclipse/jetty/osgi/** + **/org/eclipse/jetty/spring/** + **/org/eclipse/jetty/http/spi/** + + **/org/eclipse/jetty/tests/** + **/org/eclipse/jetty/test/** + + jacoco-initialize