Skip to content

Commit 3fd10ba

Browse files
committed
Skip jacoco instrumentation/coverage in jenkins build
1 parent c2be33d commit 3fd10ba

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Jenkinsfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ stage('Configure') {
4545
// We want to enable preview features when testing newer builds of OpenJDK:
4646
// even if we don't use these features, just enabling them can cause side effects
4747
// and it's useful to test that.
48-
new BuildEnvironment( testJdkVersion: '23', testJdkLauncherArgs: '--enable-preview' ),
49-
new BuildEnvironment( testJdkVersion: '24', testJdkLauncherArgs: '--enable-preview' ),
48+
new BuildEnvironment( testJdkVersion: '23', testJdkLauncherArgs: '--enable-preview', skipJacoco: true ),
49+
new BuildEnvironment( testJdkVersion: '24', testJdkLauncherArgs: '--enable-preview', skipJacoco: true ),
5050
// The following JDKs aren't supported by Hibernate ORM out-of-the box yet:
5151
// they require the use of -Dnet.bytebuddy.experimental=true.
5252
// Make sure to remove that argument as soon as possible
5353
// -- generally that requires upgrading bytebuddy after the JDK goes GA.
54-
new BuildEnvironment( testJdkVersion: '25', testJdkLauncherArgs: '--enable-preview -Dnet.bytebuddy.experimental=true' )
54+
new BuildEnvironment( testJdkVersion: '25', testJdkLauncherArgs: '--enable-preview -Dnet.bytebuddy.experimental=true', skipJacoco: true ),
5555
];
5656

5757
if ( env.CHANGE_ID ) {
@@ -130,6 +130,10 @@ stage('Build') {
130130
state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] +
131131
" -Pci.node=${buildEnv.node}"
132132
}
133+
if ( buildEnv.skipJacoco ) {
134+
state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] +
135+
" -PskipJacoco=true"
136+
}
133137
state[buildEnv.tag]['containerName'] = null;
134138
stage('Checkout') {
135139
checkout scm
@@ -215,6 +219,7 @@ class BuildEnvironment {
215219
String additionalOptions
216220
String notificationRecipients
217221
boolean longRunning
222+
boolean skipJacoco
218223

219224
String toString() { getTag() }
220225
String getTag() { "${node ? node + "_" : ''}${testJdkVersion ? 'jdk_' + testJdkVersion + '_' : '' }${dbName}" }

local-build-plugins/src/main/groovy/local.java-module.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ plugins {
1616
id "org.hibernate.orm.database-service"
1717
id "org.hibernate.orm.build.java-module"
1818

19-
id "jacoco"
2019
id "build-dashboard"
2120
id "project-report"
2221
}
@@ -27,6 +26,14 @@ def jpaVersion = ormBuildDetails.jpaVersion
2726
def java9ModuleNameBase = project.name.startsWith( 'hibernate-' ) ? name.drop( 'hibernate-'.length() ): name
2827
def java9ModuleName = "org.hibernate.orm.$java9ModuleNameBase".replace('-','.')
2928

29+
def skipJacoco = project.hasProperty('skipJacoco') ? project.getProperty('skipJacoco').toBoolean() : true
30+
System.out.println("'skipJacoco='" + skipJacoco)
31+
if (!skipJacoco) {
32+
plugins.apply('jacoco')
33+
} else {
34+
System.out.println("JaCoCo is disabled by 'skipJacoco=true' property.")
35+
}
36+
3037
sourceSets {
3138
test {
3239
resources {

0 commit comments

Comments
 (0)