Skip to content

Commit 8a27730

Browse files
authored
Run more tests concurrently in CI (#1514)
* Run sync tests together * Run reactive tests together * Run bson and crypt tests together * Run core an legacy separately JAVA-5628
1 parent afddfe9 commit 8a27730

File tree

2 files changed

+75
-22
lines changed

2 files changed

+75
-22
lines changed

.evergreen/.evg.yml

Lines changed: 69 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ functions:
287287
288288
AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" SAFE_FOR_MULTI_MONGOS="${SAFE_FOR_MULTI_MONGOS}" TOPOLOGY="${TOPOLOGY}" \
289289
COMPRESSOR="${COMPRESSOR}" JAVA_VERSION="${JAVA_VERSION}" REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \
290-
.evergreen/run-tests.sh
290+
TESTS="${TESTS}" .evergreen/run-tests.sh
291291
292292
"run load-balancer tests":
293293
- command: shell.exec
@@ -335,7 +335,7 @@ functions:
335335
AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" TOPOLOGY="${TOPOLOGY}" COMPRESSOR="${COMPRESSOR}" \
336336
JAVA_VERSION="${JAVA_VERSION}" \
337337
AZUREKMS_KEY_VAULT_ENDPOINT=${testazurekms_keyvaultendpoint} AZUREKMS_KEY_NAME=${testazurekms_keyname} \
338-
SLOW_TESTS_ONLY=true .evergreen/run-tests.sh
338+
TESTS="testSlowOnly" .evergreen/run-tests.sh
339339
340340
"run scala tests":
341341
- command: shell.exec
@@ -861,11 +861,42 @@ tasks:
861861
vars:
862862
file: ".evergreen/static-checks.sh"
863863

864-
- name: "test"
864+
- name: "test-bson-and-crypt"
865+
commands:
866+
- func: "run tests"
867+
vars:
868+
TESTS: 'bson:test bson-record-codec:test mongodb-crypt:test'
869+
870+
- name: "test-core"
871+
commands:
872+
- func: "bootstrap mongo-orchestration"
873+
- func: "run tests"
874+
vars:
875+
TESTS: 'driver-core:test'
876+
877+
- name: "test-legacy"
878+
commands:
879+
- func: "start-kms-kmip-server"
880+
- func: "bootstrap mongo-orchestration"
881+
- func: "run tests"
882+
vars:
883+
TESTS: 'driver-legacy:test'
884+
885+
- name: "test-sync"
886+
commands:
887+
- func: "start-kms-kmip-server"
888+
- func: "bootstrap mongo-orchestration"
889+
- func: "run tests"
890+
vars:
891+
TESTS: 'driver-sync:test'
892+
893+
- name: "test-reactive"
865894
commands:
866895
- func: "start-kms-kmip-server"
867896
- func: "bootstrap mongo-orchestration"
868897
- func: "run tests"
898+
vars:
899+
TESTS: 'driver-reactive-streams:test'
869900

870901
- name: load-balancer-test
871902
commands:
@@ -2105,14 +2136,20 @@ buildvariants:
21052136
display_name: "${version} ${compressor} ${topology} ${auth} ${ssl} ${jdk} ${os} "
21062137
tags: ["tests-variant"]
21072138
tasks:
2108-
- name: "test"
2139+
- name: "test-sync"
2140+
- name: "test-reactive"
2141+
- name: "test-core"
2142+
- name: "test-legacy"
21092143

21102144
- matrix_name: "tests-snappy-compression"
21112145
matrix_spec: { compressor : "snappy", auth: "noauth", ssl: "nossl", jdk: "jdk8", version: "*", topology: "standalone", os: "linux" }
21122146
display_name: "${version} ${compressor} ${topology} ${auth} ${ssl} ${jdk} ${os} "
21132147
tags: ["tests-variant"]
21142148
tasks:
2115-
- name: "test"
2149+
- name: "test-sync"
2150+
- name: "test-reactive"
2151+
- name: "test-core"
2152+
- name: "test-legacy"
21162153

21172154
- matrix_name: "tests-zstd-compression"
21182155
matrix_spec: { compressor : "zstd", auth: "noauth", ssl: "nossl", jdk: "jdk8",
@@ -2121,15 +2158,28 @@ buildvariants:
21212158
display_name: "${version} ${compressor} ${topology} ${auth} ${ssl} ${jdk} ${os} "
21222159
tags: ["tests-variant"]
21232160
tasks:
2124-
- name: "test"
2161+
- name: "test-sync"
2162+
- name: "test-reactive"
2163+
- name: "test-core"
2164+
- name: "test-legacy"
2165+
2166+
- matrix_name: "tests-unit"
2167+
matrix_spec: { jdk: [ "jdk8", "jdk11", "jdk17", "jdk21"], os: "linux" }
2168+
display_name: "${jdk} ${os} Unit"
2169+
tags: ["tests-variant"]
2170+
tasks:
2171+
- name: "test-bson-and-crypt"
21252172

21262173
- matrix_name: "tests-jdk8-unsecure"
21272174
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk8", version: ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest"],
21282175
topology: "*", os: "linux" }
21292176
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
21302177
tags: ["tests-variant"]
21312178
tasks:
2132-
- name: "test"
2179+
- name: "test-sync"
2180+
- name: "test-reactive"
2181+
- name: "test-core"
2182+
- name: "test-legacy"
21332183

21342184
- matrix_name: "tests-jdk-secure"
21352185
matrix_spec: { auth: "auth", ssl: "ssl", jdk: [ "jdk8", "jdk17", "jdk21"],
@@ -2138,22 +2188,31 @@ buildvariants:
21382188
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
21392189
tags: ["tests-variant"]
21402190
tasks:
2141-
- name: "test"
2191+
- name: "test-sync"
2192+
- name: "test-reactive"
2193+
- name: "test-core"
2194+
- name: "test-legacy"
21422195

21432196
- matrix_name: "tests-jdk-secure-jdk11"
21442197
matrix_spec: { auth: "auth", ssl: "ssl", jdk: ["jdk11"], version: ["7.0"], topology: ["replicaset"], os: "linux" }
21452198
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
21462199
tags: ["tests-variant"]
21472200
tasks:
2148-
- name: "test"
2201+
- name: "test-sync"
2202+
- name: "test-reactive"
2203+
- name: "test-core"
2204+
- name: "test-legacy"
21492205

21502206
- matrix_name: "tests-require-api-version"
21512207
matrix_spec: { api-version: "required", auth: "auth", ssl: "nossl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "8.0", "latest"],
21522208
topology: "standalone", os: "linux" }
21532209
display_name: "${version} ${topology} ${api-version} "
21542210
tags: ["tests-variant"]
21552211
tasks:
2156-
- name: "test"
2212+
- name: "test-sync"
2213+
- name: "test-reactive"
2214+
- name: "test-core"
2215+
- name: "test-legacy"
21572216

21582217
- matrix_name: "tests-load-balancer-secure"
21592218
matrix_spec: { auth: "auth", ssl: "ssl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "8.0", "latest"], topology: "sharded-cluster",

.evergreen/run-tests.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ MONGODB_URI=${MONGODB_URI:-}
3535
TOPOLOGY=${TOPOLOGY:-server}
3636
COMPRESSOR=${COMPRESSOR:-}
3737
STREAM_TYPE=${STREAM_TYPE:-nio2}
38+
TESTS=${TESTS:-test}
3839
SLOW_TESTS_ONLY=${SLOW_TESTS_ONLY:-false}
3940

4041
export ASYNC_TYPE="-Dorg.mongodb.test.async.type=${STREAM_TYPE}"
@@ -136,15 +137,8 @@ echo "Running $AUTH tests over $SSL for $TOPOLOGY and connecting to $MONGODB_URI
136137
echo "Running tests with Java ${JAVA_VERSION}"
137138
./gradlew -version
138139

139-
if [ "$SLOW_TESTS_ONLY" == "true" ]; then
140-
./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} \
141-
${MULTI_MONGOS_URI_SYSTEM_PROPERTY} ${GRADLE_EXTRA_VARS} ${ASYNC_TYPE} \
142-
${JAVA_SYSPROP_NETTY_SSL_PROVIDER} \
143-
--stacktrace --info testSlowOnly
144-
else
145-
./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} \
146-
${MULTI_MONGOS_URI_SYSTEM_PROPERTY} ${API_VERSION} ${GRADLE_EXTRA_VARS} ${ASYNC_TYPE} \
147-
${JAVA_SYSPROP_NETTY_SSL_PROVIDER} \
148-
-Dorg.mongodb.test.fle.on.demand.credential.test.failure.enabled=true \
149-
--stacktrace --info --continue test
150-
fi
140+
./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} \
141+
${MULTI_MONGOS_URI_SYSTEM_PROPERTY} ${API_VERSION} ${GRADLE_EXTRA_VARS} ${ASYNC_TYPE} \
142+
${JAVA_SYSPROP_NETTY_SSL_PROVIDER} \
143+
-Dorg.mongodb.test.fle.on.demand.credential.test.failure.enabled=true \
144+
--stacktrace --info --continue ${TESTS}

0 commit comments

Comments
 (0)