From f4ad9e036931e456868040088a0b8cd502d4a709 Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Tue, 8 Oct 2024 14:55:03 +0100 Subject: [PATCH 1/4] Grouping all static checks under the "check" task --- .evergreen/static-checks.sh | 2 +- bson-kotlin/build.gradle.kts | 7 +++---- bson-kotlinx/build.gradle.kts | 7 +++---- driver-kotlin-coroutine/build.gradle.kts | 8 +++----- driver-kotlin-extensions/build.gradle.kts | 7 +++---- driver-kotlin-sync/build.gradle.kts | 8 +++----- 6 files changed, 16 insertions(+), 23 deletions(-) diff --git a/.evergreen/static-checks.sh b/.evergreen/static-checks.sh index 8896692ca66..8b65b15e9a5 100755 --- a/.evergreen/static-checks.sh +++ b/.evergreen/static-checks.sh @@ -12,4 +12,4 @@ RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")" echo "Compiling JVM drivers" ./gradlew -version -./gradlew -PxmlReports.enabled=true --info -x test -x integrationTest -x spotlessApply clean check scalaCheck kotlinCheck jar testClasses docs +./gradlew -PxmlReports.enabled=true --info -x test -x integrationTest -x spotlessApply clean check scalaCheck jar testClasses docs diff --git a/bson-kotlin/build.gradle.kts b/bson-kotlin/build.gradle.kts index 3840b3169cf..70d6f370173 100644 --- a/bson-kotlin/build.gradle.kts +++ b/bson-kotlin/build.gradle.kts @@ -111,12 +111,11 @@ spotbugs { showProgress.set(true) } // =========================== // Test Configuration // =========================== -tasks.create("kotlinCheck") { - description = "Runs all the kotlin checks" +tasks.findByName("check")?.run { + description = "Runs static checks and unit test" group = "verification" - dependsOn("clean", "check") - tasks.findByName("check")?.mustRunAfter("clean") + dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") } tasks.test { useJUnitPlatform() } diff --git a/bson-kotlinx/build.gradle.kts b/bson-kotlinx/build.gradle.kts index a278b4a3ab2..eb5f8cfa867 100644 --- a/bson-kotlinx/build.gradle.kts +++ b/bson-kotlinx/build.gradle.kts @@ -128,12 +128,11 @@ spotbugs { showProgress.set(true) } // =========================== // Test Configuration // =========================== -tasks.create("kotlinCheck") { - description = "Runs all the kotlin checks" +tasks.findByName("check")?.run { + description = "Runs static checks and unit test" group = "verification" - dependsOn("clean", "check") - tasks.findByName("check")?.mustRunAfter("clean") + dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") } tasks.test { useJUnitPlatform() } diff --git a/driver-kotlin-coroutine/build.gradle.kts b/driver-kotlin-coroutine/build.gradle.kts index abd81fcd1d3..23690b1e8e6 100644 --- a/driver-kotlin-coroutine/build.gradle.kts +++ b/driver-kotlin-coroutine/build.gradle.kts @@ -156,13 +156,11 @@ val integrationTest = classpath = sourceSets["integrationTest"].runtimeClasspath } -tasks.create("kotlinCheck") { - description = "Runs all the kotlin checks" +tasks.findByName("check")?.run { + description = "Runs static checks and unit test" group = "verification" - dependsOn("clean", "check", integrationTest) - tasks.findByName("check")?.mustRunAfter("clean") - tasks.findByName("integrationTest")?.mustRunAfter("check") + dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") } tasks.test { useJUnitPlatform() } diff --git a/driver-kotlin-extensions/build.gradle.kts b/driver-kotlin-extensions/build.gradle.kts index 33fa0fa4294..24c3a4cda7b 100644 --- a/driver-kotlin-extensions/build.gradle.kts +++ b/driver-kotlin-extensions/build.gradle.kts @@ -127,12 +127,11 @@ tasks.spotbugsMain { // Test Configuration // =========================== -tasks.create("kotlinCheck") { - description = "Runs all the kotlin checks" +tasks.findByName("check")?.run { + description = "Runs static checks and unit test" group = "verification" - dependsOn("clean", "check") - tasks.findByName("check")?.mustRunAfter("clean") + dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") } tasks.test { useJUnitPlatform() } diff --git a/driver-kotlin-sync/build.gradle.kts b/driver-kotlin-sync/build.gradle.kts index 05b20b4803b..6edea3de3df 100644 --- a/driver-kotlin-sync/build.gradle.kts +++ b/driver-kotlin-sync/build.gradle.kts @@ -150,13 +150,11 @@ val integrationTest = classpath = sourceSets["integrationTest"].runtimeClasspath } -tasks.create("kotlinCheck") { - description = "Runs all the kotlin checks" +tasks.findByName("check")?.run { + description = "Runs static checks and unit test" group = "verification" - dependsOn("clean", "check", integrationTest) - tasks.findByName("check")?.mustRunAfter("clean") - tasks.findByName("integrationTest")?.mustRunAfter("check") + dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") } tasks.test { useJUnitPlatform() } From 5ee43a228b122d5283dec8be0a475ff7851565cb Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Tue, 8 Oct 2024 16:03:09 +0100 Subject: [PATCH 2/4] Removing deleted task --- .evergreen/run-kotlin-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/run-kotlin-tests.sh b/.evergreen/run-kotlin-tests.sh index fecceb28c53..9282f98bb9f 100755 --- a/.evergreen/run-kotlin-tests.sh +++ b/.evergreen/run-kotlin-tests.sh @@ -34,4 +34,4 @@ fi echo "Running Kotlin tests" ./gradlew -version -./gradlew kotlinCheck -Dorg.mongodb.test.uri=${MONGODB_URI} ${MULTI_MONGOS_URI_SYSTEM_PROPERTY} +./gradlew -Dorg.mongodb.test.uri=${MONGODB_URI} ${MULTI_MONGOS_URI_SYSTEM_PROPERTY} From 90624f4130e7ed95b68d4f833d54cb40e069c3b8 Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Tue, 8 Oct 2024 22:05:54 +0100 Subject: [PATCH 3/4] Adding Kotlin unit and integration tests --- .evergreen/run-kotlin-tests.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.evergreen/run-kotlin-tests.sh b/.evergreen/run-kotlin-tests.sh index 9282f98bb9f..a82c66e9e54 100755 --- a/.evergreen/run-kotlin-tests.sh +++ b/.evergreen/run-kotlin-tests.sh @@ -31,7 +31,10 @@ if [ "$SAFE_FOR_MULTI_MONGOS" == "true" ]; then export MULTI_MONGOS_URI_SYSTEM_PROPERTY="-Dorg.mongodb.test.multi.mongos.uri=${MONGODB_URI}" fi -echo "Running Kotlin tests" - ./gradlew -version -./gradlew -Dorg.mongodb.test.uri=${MONGODB_URI} ${MULTI_MONGOS_URI_SYSTEM_PROPERTY} + +echo "Running Kotlin Unit Tests" +./gradlew :bson-kotlin:test :bson-kotlinx:test :driver-kotlin-sync:test :driver-kotlin-coroutine:test :driver-kotlin-extensions:test + +echo "Running Kotlin Integration Tests" +./gradlew :driver-kotlin-sync:integrationTest :driver-kotlin-coroutine:integrationTest -Dorg.mongodb.test.uri=${MONGODB_URI} ${MULTI_MONGOS_URI_SYSTEM_PROPERTY} From 434f82f12fdd70b160b95f30e9fd5708a45bfd6a Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Mon, 14 Oct 2024 14:05:55 +0100 Subject: [PATCH 4/4] "check" task already depends on our static checks no need to redefine them --- bson-kotlin/build.gradle.kts | 6 ------ bson-kotlinx/build.gradle.kts | 6 ------ driver-kotlin-coroutine/build.gradle.kts | 7 ------- driver-kotlin-extensions/build.gradle.kts | 7 ------- driver-kotlin-sync/build.gradle.kts | 7 ------- 5 files changed, 33 deletions(-) diff --git a/bson-kotlin/build.gradle.kts b/bson-kotlin/build.gradle.kts index 70d6f370173..45e8c9c0e5d 100644 --- a/bson-kotlin/build.gradle.kts +++ b/bson-kotlin/build.gradle.kts @@ -111,12 +111,6 @@ spotbugs { showProgress.set(true) } // =========================== // Test Configuration // =========================== -tasks.findByName("check")?.run { - description = "Runs static checks and unit test" - group = "verification" - - dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") -} tasks.test { useJUnitPlatform() } diff --git a/bson-kotlinx/build.gradle.kts b/bson-kotlinx/build.gradle.kts index eb5f8cfa867..ac0b07f18eb 100644 --- a/bson-kotlinx/build.gradle.kts +++ b/bson-kotlinx/build.gradle.kts @@ -128,12 +128,6 @@ spotbugs { showProgress.set(true) } // =========================== // Test Configuration // =========================== -tasks.findByName("check")?.run { - description = "Runs static checks and unit test" - group = "verification" - - dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") -} tasks.test { useJUnitPlatform() } diff --git a/driver-kotlin-coroutine/build.gradle.kts b/driver-kotlin-coroutine/build.gradle.kts index 23690b1e8e6..96ac4cc31eb 100644 --- a/driver-kotlin-coroutine/build.gradle.kts +++ b/driver-kotlin-coroutine/build.gradle.kts @@ -156,13 +156,6 @@ val integrationTest = classpath = sourceSets["integrationTest"].runtimeClasspath } -tasks.findByName("check")?.run { - description = "Runs static checks and unit test" - group = "verification" - - dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") -} - tasks.test { useJUnitPlatform() } // =========================== diff --git a/driver-kotlin-extensions/build.gradle.kts b/driver-kotlin-extensions/build.gradle.kts index 24c3a4cda7b..5db6609a6f6 100644 --- a/driver-kotlin-extensions/build.gradle.kts +++ b/driver-kotlin-extensions/build.gradle.kts @@ -127,13 +127,6 @@ tasks.spotbugsMain { // Test Configuration // =========================== -tasks.findByName("check")?.run { - description = "Runs static checks and unit test" - group = "verification" - - dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") -} - tasks.test { useJUnitPlatform() } // =========================== diff --git a/driver-kotlin-sync/build.gradle.kts b/driver-kotlin-sync/build.gradle.kts index 6edea3de3df..e7fb132cb36 100644 --- a/driver-kotlin-sync/build.gradle.kts +++ b/driver-kotlin-sync/build.gradle.kts @@ -150,13 +150,6 @@ val integrationTest = classpath = sourceSets["integrationTest"].runtimeClasspath } -tasks.findByName("check")?.run { - description = "Runs static checks and unit test" - group = "verification" - - dependsOn("spotlessCheck", "spotbugsMain", "spotbugsMain", "detekt") -} - tasks.test { useJUnitPlatform() } // ===========================