Skip to content

Commit

Permalink
Run more tests concurrently in CI
Browse files Browse the repository at this point in the history
* Run sync tests together
* Run reactive tests together
* Run core and legacy together
* Run bson and crypt tests together

JAVA-5628
  • Loading branch information
jyemin committed Sep 25, 2024
1 parent b866e88 commit dfc553e
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 22 deletions.
65 changes: 55 additions & 10 deletions .evergreen/.evg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ functions:
AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" SAFE_FOR_MULTI_MONGOS="${SAFE_FOR_MULTI_MONGOS}" TOPOLOGY="${TOPOLOGY}" \
COMPRESSOR="${COMPRESSOR}" JAVA_VERSION="${JAVA_VERSION}" REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \
.evergreen/run-tests.sh
TESTS="${TESTS}" .evergreen/run-tests.sh
"run load-balancer tests":
- command: shell.exec
Expand Down Expand Up @@ -335,7 +335,7 @@ functions:
AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" TOPOLOGY="${TOPOLOGY}" COMPRESSOR="${COMPRESSOR}" \
JAVA_VERSION="${JAVA_VERSION}" \
AZUREKMS_KEY_VAULT_ENDPOINT=${testazurekms_keyvaultendpoint} AZUREKMS_KEY_NAME=${testazurekms_keyname} \
SLOW_TESTS_ONLY=true .evergreen/run-tests.sh
TESTS="testSlowOnly" .evergreen/run-tests.sh
"run scala tests":
- command: shell.exec
Expand Down Expand Up @@ -861,11 +861,35 @@ tasks:
vars:
file: ".evergreen/static-checks.sh"

- name: "test"
- name: "test-bson-and-crypt"
commands:
- func: "run tests"
vars:
TESTS: 'bson:test bson-kotlin:test bson-kotlinx:test bson-scala:test bson-record-codec:test mongodb-crypt:test'

- name: "test-core-and-legacy"
commands:
- func: "start-kms-kmip-server"
- func: "bootstrap mongo-orchestration"
- func: "run tests"
vars:
TESTS: 'driver-core:test driver-legacy:test'

- name: "test-sync"
commands:
- func: "start-kms-kmip-server"
- func: "bootstrap mongo-orchestration"
- func: "run tests"
vars:
TESTS: 'driver-sync:test driver-kotlin-sync:test'

- name: "test-reactive"
commands:
- func: "start-kms-kmip-server"
- func: "bootstrap mongo-orchestration"
- func: "run tests"
vars:
TESTS: 'driver-reactive-streams:test driver-kotlin-coroutine:test'

- name: load-balancer-test
commands:
Expand Down Expand Up @@ -2105,14 +2129,18 @@ buildvariants:
display_name: "${version} ${compressor} ${topology} ${auth} ${ssl} ${jdk} ${os} "
tags: ["tests-variant"]
tasks:
- name: "test"
- name: "test-sync"
- name: "test-reactive"
- name: "test-core-and-legacy"

- matrix_name: "tests-snappy-compression"
matrix_spec: { compressor : "snappy", auth: "noauth", ssl: "nossl", jdk: "jdk8", version: "*", topology: "standalone", os: "linux" }
display_name: "${version} ${compressor} ${topology} ${auth} ${ssl} ${jdk} ${os} "
tags: ["tests-variant"]
tasks:
- name: "test"
- name: "test-sync"
- name: "test-reactive"
- name: "test-core-and-legacy"

- matrix_name: "tests-zstd-compression"
matrix_spec: { compressor : "zstd", auth: "noauth", ssl: "nossl", jdk: "jdk8",
Expand All @@ -2121,15 +2149,26 @@ buildvariants:
display_name: "${version} ${compressor} ${topology} ${auth} ${ssl} ${jdk} ${os} "
tags: ["tests-variant"]
tasks:
- name: "test"
- name: "test-sync"
- name: "test-reactive"
- name: "test-core-and-legacy"

- matrix_name: "tests-unit"
matrix_spec: { jdk: [ "jdk8", "jdk11", "jdk17", "jdk21"], os: "linux" }
display_name: "${jdk} ${os} Unit"
tags: ["tests-variant"]
tasks:
- name: "test-bson-and-crypt"

- matrix_name: "tests-jdk8-unsecure"
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk8", version: ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest"],
topology: "*", os: "linux" }
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
tags: ["tests-variant"]
tasks:
- name: "test"
- name: "test-sync"
- name: "test-reactive"
- name: "test-core-and-legacy"

- matrix_name: "tests-jdk-secure"
matrix_spec: { auth: "auth", ssl: "ssl", jdk: [ "jdk8", "jdk17", "jdk21"],
Expand All @@ -2138,22 +2177,28 @@ buildvariants:
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
tags: ["tests-variant"]
tasks:
- name: "test"
- name: "test-sync"
- name: "test-reactive"
- name: "test-core-and-legacy"

- matrix_name: "tests-jdk-secure-jdk11"
matrix_spec: { auth: "auth", ssl: "ssl", jdk: ["jdk11"], version: ["7.0"], topology: ["replicaset"], os: "linux" }
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
tags: ["tests-variant"]
tasks:
- name: "test"
- name: "test-sync"
- name: "test-reactive"
- name: "test-core-and-legacy"

- matrix_name: "tests-require-api-version"
matrix_spec: { api-version: "required", auth: "auth", ssl: "nossl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "8.0", "latest"],
topology: "standalone", os: "linux" }
display_name: "${version} ${topology} ${api-version} "
tags: ["tests-variant"]
tasks:
- name: "test"
- name: "test-sync"
- name: "test-reactive"
- name: "test-core-and-legacy"

- matrix_name: "tests-load-balancer-secure"
matrix_spec: { auth: "auth", ssl: "ssl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "8.0", "latest"], topology: "sharded-cluster",
Expand Down
18 changes: 6 additions & 12 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ MONGODB_URI=${MONGODB_URI:-}
TOPOLOGY=${TOPOLOGY:-server}
COMPRESSOR=${COMPRESSOR:-}
STREAM_TYPE=${STREAM_TYPE:-nio2}
TESTS=${TESTS:-test}
SLOW_TESTS_ONLY=${SLOW_TESTS_ONLY:-false}

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

if [ "$SLOW_TESTS_ONLY" == "true" ]; then
./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} \
${MULTI_MONGOS_URI_SYSTEM_PROPERTY} ${GRADLE_EXTRA_VARS} ${ASYNC_TYPE} \
${JAVA_SYSPROP_NETTY_SSL_PROVIDER} \
--stacktrace --info testSlowOnly
else
./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} \
${MULTI_MONGOS_URI_SYSTEM_PROPERTY} ${API_VERSION} ${GRADLE_EXTRA_VARS} ${ASYNC_TYPE} \
${JAVA_SYSPROP_NETTY_SSL_PROVIDER} \
-Dorg.mongodb.test.fle.on.demand.credential.test.failure.enabled=true \
--stacktrace --info --continue test
fi
./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} \
${MULTI_MONGOS_URI_SYSTEM_PROPERTY} ${API_VERSION} ${GRADLE_EXTRA_VARS} ${ASYNC_TYPE} \
${JAVA_SYSPROP_NETTY_SSL_PROVIDER} \
-Dorg.mongodb.test.fle.on.demand.credential.test.failure.enabled=true \
--stacktrace --info --continue ${TESTS}

0 comments on commit dfc553e

Please sign in to comment.