From dfc553e553cfd450e086507cafb0ddca1cf48c8e Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Wed, 25 Sep 2024 07:57:03 -0400 Subject: [PATCH 1/3] Run more tests concurrently in CI * Run sync tests together * Run reactive tests together * Run core and legacy together * Run bson and crypt tests together JAVA-5628 --- .evergreen/.evg.yml | 65 ++++++++++++++++++++++++++++++++++------- .evergreen/run-tests.sh | 18 ++++-------- 2 files changed, 61 insertions(+), 22 deletions(-) diff --git a/.evergreen/.evg.yml b/.evergreen/.evg.yml index 2499bc884df..7471a4386fe 100644 --- a/.evergreen/.evg.yml +++ b/.evergreen/.evg.yml @@ -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 @@ -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 @@ -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: @@ -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", @@ -2121,7 +2149,16 @@ 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"], @@ -2129,7 +2166,9 @@ 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" matrix_spec: { auth: "auth", ssl: "ssl", jdk: [ "jdk8", "jdk17", "jdk21"], @@ -2138,14 +2177,18 @@ 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"], @@ -2153,7 +2196,9 @@ buildvariants: 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", diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 49390e88d26..f8e90977e36 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -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}" @@ -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} From 370c4a1f10a938f5cfd24f4274da2ca4791e0a9b Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Wed, 2 Oct 2024 09:30:05 -0400 Subject: [PATCH 2/3] * Remove kotlin tests * Separate legacy tests --- .evergreen/.evg.yml | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.evergreen/.evg.yml b/.evergreen/.evg.yml index 7471a4386fe..e35b13ab394 100644 --- a/.evergreen/.evg.yml +++ b/.evergreen/.evg.yml @@ -865,15 +865,21 @@ tasks: commands: - func: "run tests" vars: - TESTS: 'bson:test bson-kotlin:test bson-kotlinx:test bson-scala:test bson-record-codec:test mongodb-crypt:test' + TESTS: 'bson:test bson-record-codec:test mongodb-crypt:test' - - name: "test-core-and-legacy" + - 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-core:test driver-legacy:test' + TESTS: 'driver-legacy:test' - name: "test-sync" commands: @@ -881,7 +887,7 @@ tasks: - func: "bootstrap mongo-orchestration" - func: "run tests" vars: - TESTS: 'driver-sync:test driver-kotlin-sync:test' + TESTS: 'driver-sync:test' - name: "test-reactive" commands: @@ -889,7 +895,7 @@ tasks: - func: "bootstrap mongo-orchestration" - func: "run tests" vars: - TESTS: 'driver-reactive-streams:test driver-kotlin-coroutine:test' + TESTS: 'driver-reactive-streams:test' - name: load-balancer-test commands: @@ -2131,7 +2137,8 @@ buildvariants: tasks: - name: "test-sync" - name: "test-reactive" - - name: "test-core-and-legacy" + - 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" } @@ -2140,7 +2147,8 @@ buildvariants: tasks: - name: "test-sync" - name: "test-reactive" - - name: "test-core-and-legacy" + - name: "test-core" + - name: "test-legacy" - matrix_name: "tests-zstd-compression" matrix_spec: { compressor : "zstd", auth: "noauth", ssl: "nossl", jdk: "jdk8", @@ -2151,7 +2159,8 @@ buildvariants: tasks: - name: "test-sync" - name: "test-reactive" - - name: "test-core-and-legacy" + - name: "test-core" + - name: "test-legacy" - matrix_name: "tests-unit" matrix_spec: { jdk: [ "jdk8", "jdk11", "jdk17", "jdk21"], os: "linux" } @@ -2168,7 +2177,8 @@ buildvariants: tasks: - name: "test-sync" - name: "test-reactive" - - name: "test-core-and-legacy" + - name: "test-core" + - name: "test-legacy" - matrix_name: "tests-jdk-secure" matrix_spec: { auth: "auth", ssl: "ssl", jdk: [ "jdk8", "jdk17", "jdk21"], @@ -2179,7 +2189,8 @@ buildvariants: tasks: - name: "test-sync" - name: "test-reactive" - - name: "test-core-and-legacy" + - 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" } @@ -2188,7 +2199,8 @@ buildvariants: tasks: - name: "test-sync" - name: "test-reactive" - - name: "test-core-and-legacy" + - 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"], @@ -2198,7 +2210,8 @@ buildvariants: tasks: - name: "test-sync" - name: "test-reactive" - - name: "test-core-and-legacy" + - 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", From e87023e048047fa6f43da3606ba846136254a1ce Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Wed, 2 Oct 2024 09:40:24 -0400 Subject: [PATCH 3/3] * Add kmip server back to legacy --- .evergreen/.evg.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.evergreen/.evg.yml b/.evergreen/.evg.yml index e35b13ab394..49c3b328bfe 100644 --- a/.evergreen/.evg.yml +++ b/.evergreen/.evg.yml @@ -876,6 +876,7 @@ tasks: - name: "test-legacy" commands: + - func: "start-kms-kmip-server" - func: "bootstrap mongo-orchestration" - func: "run tests" vars: