From 05448a36ead17c5089b8778003108109a602dfa1 Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Wed, 9 Aug 2023 10:25:40 +0100 Subject: [PATCH] Evergreen: Updated static checks Ensures that Kotlin and Scala checks are also run JAVA-5095 --- .evergreen/.evg.yml | 2 +- .evergreen/run-kotlin-tests.sh | 2 +- .evergreen/run-scala-tests.sh | 2 +- .evergreen/{compile.sh => static-checks.sh} | 4 ++-- bson-kotlin/build.gradle.kts | 2 +- bson-kotlinx/build.gradle.kts | 2 +- bson-scala/build.gradle | 11 +++++++++++ driver-kotlin-coroutine/build.gradle.kts | 2 +- driver-kotlin-sync/build.gradle.kts | 2 +- driver-scala/build.gradle | 12 ++++++++++++ 10 files changed, 32 insertions(+), 9 deletions(-) rename .evergreen/{compile.sh => static-checks.sh} (80%) diff --git a/.evergreen/.evg.yml b/.evergreen/.evg.yml index cf4ef81ab12..302be327499 100644 --- a/.evergreen/.evg.yml +++ b/.evergreen/.evg.yml @@ -901,7 +901,7 @@ tasks: commands: - func: "exec script" vars: - file: ".evergreen/compile.sh" + file: ".evergreen/static-checks.sh" - name: "test" commands: diff --git a/.evergreen/run-kotlin-tests.sh b/.evergreen/run-kotlin-tests.sh index 6cbc9a3a40d..fecceb28c53 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 kCheck -Dorg.mongodb.test.uri=${MONGODB_URI} ${MULTI_MONGOS_URI_SYSTEM_PROPERTY} +./gradlew kotlinCheck -Dorg.mongodb.test.uri=${MONGODB_URI} ${MULTI_MONGOS_URI_SYSTEM_PROPERTY} diff --git a/.evergreen/run-scala-tests.sh b/.evergreen/run-scala-tests.sh index a1065ac4d3d..b7b0ec7d5ff 100755 --- a/.evergreen/run-scala-tests.sh +++ b/.evergreen/run-scala-tests.sh @@ -34,4 +34,4 @@ fi echo "Running scala tests with Scala $SCALA" ./gradlew -version -./gradlew -PscalaVersion=$SCALA --stacktrace --info :bson-scala:test :driver-scala:test :driver-scala:integrationTest -Dorg.mongodb.test.uri=${MONGODB_URI} ${MULTI_MONGOS_URI_SYSTEM_PROPERTY} +./gradlew -PscalaVersion=$SCALA --stacktrace --info scalaCheck -Dorg.mongodb.test.uri=${MONGODB_URI} ${MULTI_MONGOS_URI_SYSTEM_PROPERTY} diff --git a/.evergreen/compile.sh b/.evergreen/static-checks.sh similarity index 80% rename from .evergreen/compile.sh rename to .evergreen/static-checks.sh index 2e68517254f..8896692ca66 100755 --- a/.evergreen/compile.sh +++ b/.evergreen/static-checks.sh @@ -9,7 +9,7 @@ set -o errexit # Exit the script with error if any of the commands fail RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")" . "${RELATIVE_DIR_PATH}/javaConfig.bash" -echo "Compiling java driver" +echo "Compiling JVM drivers" ./gradlew -version -./gradlew -PxmlReports.enabled=true --info -x test -x integrationTest -x spotlessApply clean check jar testClasses docs +./gradlew -PxmlReports.enabled=true --info -x test -x integrationTest -x spotlessApply clean check scalaCheck kotlinCheck jar testClasses docs diff --git a/bson-kotlin/build.gradle.kts b/bson-kotlin/build.gradle.kts index 2bf0c4df900..5d46bdd51ca 100644 --- a/bson-kotlin/build.gradle.kts +++ b/bson-kotlin/build.gradle.kts @@ -111,7 +111,7 @@ spotbugs { showProgress.set(true) } // =========================== // Test Configuration // =========================== -tasks.create("kCheck") { +tasks.create("kotlinCheck") { description = "Runs all the kotlin checks" group = "verification" diff --git a/bson-kotlinx/build.gradle.kts b/bson-kotlinx/build.gradle.kts index 4601cd9c4f8..14d823e04d5 100644 --- a/bson-kotlinx/build.gradle.kts +++ b/bson-kotlinx/build.gradle.kts @@ -115,7 +115,7 @@ spotbugs { showProgress.set(true) } // =========================== // Test Configuration // =========================== -tasks.create("kCheck") { +tasks.create("kotlinCheck") { description = "Runs all the kotlin checks" group = "verification" diff --git a/bson-scala/build.gradle b/bson-scala/build.gradle index 45743f2a5d9..e2c48a87d77 100644 --- a/bson-scala/build.gradle +++ b/bson-scala/build.gradle @@ -39,6 +39,17 @@ tasks.withType(Test) { } } +// =================== +// Scala checks +// =================== +tasks.register("scalaCheck") { + description = "Runs all the Scala checks" + group = "verification" + + dependsOn("clean", "compileTestScala", "check") + tasks.findByName("check").mustRunAfter("clean") +} + ext { pomName = 'Mongo Scala Bson Library' } diff --git a/driver-kotlin-coroutine/build.gradle.kts b/driver-kotlin-coroutine/build.gradle.kts index 0b4f1ee53ef..65117893705 100644 --- a/driver-kotlin-coroutine/build.gradle.kts +++ b/driver-kotlin-coroutine/build.gradle.kts @@ -155,7 +155,7 @@ val integrationTest = classpath = sourceSets["integrationTest"].runtimeClasspath } -tasks.create("kCheck") { +tasks.create("kotlinCheck") { description = "Runs all the kotlin checks" group = "verification" diff --git a/driver-kotlin-sync/build.gradle.kts b/driver-kotlin-sync/build.gradle.kts index 223fa711a78..b0b9fcd0b8b 100644 --- a/driver-kotlin-sync/build.gradle.kts +++ b/driver-kotlin-sync/build.gradle.kts @@ -150,7 +150,7 @@ val integrationTest = classpath = sourceSets["integrationTest"].runtimeClasspath } -tasks.create("kCheck") { +tasks.create("kotlinCheck") { description = "Runs all the kotlin checks" group = "verification" diff --git a/driver-scala/build.gradle b/driver-scala/build.gradle index 479e5ea9a35..0c721d6d1d9 100644 --- a/driver-scala/build.gradle +++ b/driver-scala/build.gradle @@ -69,6 +69,18 @@ task integrationTest(type: Test) { check.dependsOn integrationTest +// =================== +// Scala checks +// =================== +tasks.register("scalaCheck") { + description = "Runs all the Scala checks" + group = "verification" + + dependsOn("clean", "compileTestScala", "compileIntegrationTestScala", "check") + tasks.findByName("check").mustRunAfter("clean") +} + + task aggregatedScalaDoc(type: ScalaDoc) { description('Unified Scaladoc for bson-scala and driver-scala') group('documentation')