Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run more tests concurrently in CI #1514

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 69 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,42 @@ tasks:
vars:
file: ".evergreen/static-checks.sh"

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

- name: "test-core"
commands:
- func: "bootstrap mongo-orchestration"
- func: "run tests"
vars:
TESTS: 'driver-core:test'

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

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

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

- name: load-balancer-test
commands:
Expand Down Expand Up @@ -2105,14 +2136,20 @@ 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"
- name: "test-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"
- name: "test-legacy"

- matrix_name: "tests-zstd-compression"
matrix_spec: { compressor : "zstd", auth: "noauth", ssl: "nossl", jdk: "jdk8",
Expand All @@ -2121,15 +2158,28 @@ 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"
- name: "test-legacy"

- matrix_name: "tests-unit"
Copy link
Contributor Author

@jyemin jyemin Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just run unit tests once on each JDK, instead of with every topology and release of MongoDB.

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"
jyemin marked this conversation as resolved.
Show resolved Hide resolved
- name: "test-reactive"
- name: "test-core"
- name: "test-legacy"

- matrix_name: "tests-jdk-secure"
matrix_spec: { auth: "auth", ssl: "ssl", jdk: [ "jdk8", "jdk17", "jdk21"],
Expand All @@ -2138,22 +2188,31 @@ buildvariants:
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
tags: ["tests-variant"]
tasks:
- name: "test"
- name: "test-sync"
- name: "test-reactive"
- name: "test-core"
- name: "test-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"
- name: "test-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"
- name: "test-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}