Skip to content

Commit a4fa889

Browse files
authored
Properly split integration tests (elastic#2393)
1 parent e756114 commit a4fa889

File tree

5 files changed

+73
-45
lines changed

5 files changed

+73
-45
lines changed

Jenkinsfile

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ pipeline {
3535
parameters {
3636
string(name: 'MAVEN_CONFIG', defaultValue: '-V -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dhttps.protocols=TLSv1.2 -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25', description: 'Additional maven options.')
3737
booleanParam(name: 'test_ci', defaultValue: true, description: 'Enable Unit tests')
38-
booleanParam(name: 'smoketests_ci', defaultValue: true, description: 'Enable Smoke tests')
39-
booleanParam(name: 'integrationtests_ci', defaultValue: true, description: 'Enable Integration tests')
38+
booleanParam(name: 'agent_integration_tests_ci', defaultValue: true, description: 'Enable Agent Integration tests')
39+
booleanParam(name: 'endtoend_tests_ci', defaultValue: true, description: 'Enable APM End-to-End Integration tests')
4040
booleanParam(name: 'bench_ci', defaultValue: true, description: 'Enable benchmarks')
4141
booleanParam(name: 'compatibility_ci', defaultValue: false, description: 'Enable JDK compatibility tests')
4242
}
@@ -153,10 +153,7 @@ pipeline {
153153
}
154154
}
155155
}
156-
/**
157-
Run smoke tests for different servers and databases.
158-
*/
159-
stage('Smoke Tests 01') {
156+
stage('Non-Application Server integration tests') {
160157
agent { label 'linux && immutable' }
161158
options { skipDefaultCheckout() }
162159
environment {
@@ -166,15 +163,15 @@ pipeline {
166163
}
167164
when {
168165
beforeAgent true
169-
expression { return params.smoketests_ci }
166+
expression { return params.agent_integration_tests_ci }
170167
}
171168
steps {
172-
withGithubNotify(context: 'Smoke Tests 01', tab: 'tests') {
169+
withGithubNotify(context: 'Non-Application Server integration tests', tab: 'tests') {
173170
deleteDir()
174171
unstashV2(name: 'build', bucket: "${JOB_GCS_BUCKET_STASH}", credentialsId: "${JOB_GCS_CREDENTIALS}")
175172
dir("${BASE_DIR}"){
176173
withOtelEnv() {
177-
sh './scripts/jenkins/smoketests-01.sh'
174+
sh './mvnw -q -P ci-non-application-server-integration-tests verify'
178175
}
179176
}
180177
}
@@ -185,10 +182,7 @@ pipeline {
185182
}
186183
}
187184
}
188-
/**
189-
Run smoke tests for different servers and databases.
190-
*/
191-
stage('Smoke Tests 02') {
185+
stage('Application Server integration tests') {
192186
agent { label 'linux && immutable' }
193187
options { skipDefaultCheckout() }
194188
environment {
@@ -198,15 +192,15 @@ pipeline {
198192
}
199193
when {
200194
beforeAgent true
201-
expression { return params.smoketests_ci }
195+
expression { return params.agent_integration_tests_ci }
202196
}
203197
steps {
204-
withGithubNotify(context: 'Smoke Tests 02', tab: 'tests') {
198+
withGithubNotify(context: 'Application Server integration tests', tab: 'tests') {
205199
deleteDir()
206200
unstashV2(name: 'build', bucket: "${JOB_GCS_BUCKET_STASH}", credentialsId: "${JOB_GCS_CREDENTIALS}")
207201
dir("${BASE_DIR}"){
208202
withOtelEnv() {
209-
sh './scripts/jenkins/smoketests-02.sh'
203+
sh './mvnw -q -P ci-application-server-integration-tests verify'
210204
}
211205
}
212206
}
@@ -295,14 +289,14 @@ pipeline {
295289
}
296290
}
297291
}
298-
stage('Integration Tests') {
292+
stage('End-To-End Integration Tests') {
299293
agent none
300294
when {
301295
allOf {
302296
expression { return env.ONLY_DOCS == "false" }
303297
anyOf {
304298
changeRequest()
305-
expression { return params.integrationtests_ci }
299+
expression { return params.endtoend_tests_ci }
306300
expression { return env.GITHUB_COMMENT?.contains('integration tests') }
307301
}
308302
}

integration-tests/application-server-integration-tests/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,25 @@
169169
-->
170170
</dependencies>
171171

172+
<profiles>
173+
<profile>
174+
<id>ci-application-server-integration-tests</id>
175+
<activation>
176+
<activeByDefault>false</activeByDefault>
177+
</activation>
178+
<properties>
179+
<skip.integration.test>false</skip.integration.test>
180+
</properties>
181+
</profile>
182+
<profile>
183+
<id>ci-non-application-server-integration-tests</id>
184+
<activation>
185+
<activeByDefault>false</activeByDefault>
186+
</activation>
187+
<properties>
188+
<skip.integration.test>true</skip.integration.test>
189+
</properties>
190+
</profile>
191+
</profiles>
192+
172193
</project>

pom.xml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,18 @@
159159
</properties>
160160
</profile>
161161
<profile>
162-
<id>integration-test-only</id>
162+
<id>ci-non-application-server-integration-tests</id>
163163
<activation>
164164
<activeByDefault>false</activeByDefault>
165165
</activation>
166166
<properties>
167-
<skip.unit.test>true</skip.unit.test>
167+
<!--
168+
By default, enables all integration tests.
169+
In integration-tests/application-server-integration-tests/pom.xml,
170+
only that module is excluded by overriding skip.integration.test to true.
171+
-->
168172
<skip.integration.test>false</skip.integration.test>
173+
<maven.javadoc.skip>true</maven.javadoc.skip>
169174
</properties>
170175
<build>
171176
<plugins>
@@ -178,9 +183,39 @@
178183
<plugin>
179184
<artifactId>maven-surefire-plugin</artifactId>
180185
<configuration>
181-
<enableAssertions>true</enableAssertions>
182-
<trimStackTrace>false</trimStackTrace>
183-
<skipTests>${skip.unit.test}</skipTests>
186+
<skipTests>true</skipTests>
187+
</configuration>
188+
</plugin>
189+
</plugins>
190+
</build>
191+
</profile>
192+
<profile>
193+
<id>ci-application-server-integration-tests</id>
194+
<activation>
195+
<activeByDefault>false</activeByDefault>
196+
</activation>
197+
<properties>
198+
<!--
199+
By default, disables all integration tests.
200+
In integration-tests/application-server-integration-tests/pom.xml,
201+
only that module is included by overriding skip.integration.test to false.
202+
-->
203+
<skip.integration.test>true</skip.integration.test>
204+
<maven.javadoc.skip>true</maven.javadoc.skip>
205+
<animal.sniffer.skip>true</animal.sniffer.skip>
206+
</properties>
207+
<build>
208+
<plugins>
209+
<plugin>
210+
<artifactId>maven-failsafe-plugin</artifactId>
211+
<configuration>
212+
<skipTests>${skip.integration.test}</skipTests>
213+
</configuration>
214+
</plugin>
215+
<plugin>
216+
<artifactId>maven-surefire-plugin</artifactId>
217+
<configuration>
218+
<skipTests>true</skipTests>
184219
</configuration>
185220
</plugin>
186221
</plugins>

scripts/jenkins/smoketests-01.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

scripts/jenkins/smoketests-02.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)