Skip to content

Grouping static checks under the same task #1526

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

Merged
merged 4 commits into from
Oct 14, 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
9 changes: 6 additions & 3 deletions .evergreen/run-kotlin-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 kotlinCheck -Dorg.mongodb.test.uri=${MONGODB_URI} ${MULTI_MONGOS_URI_SYSTEM_PROPERTY}
Copy link
Member

Choose a reason for hiding this comment

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

Ah!this is probably why kotlinCheck was added as a task. Here nothing will run as there is no task passed to gradlew.

A couple of options could be:

  1. Keep kotlinCheck and only depend on test tasks
  2. List all the kotlin projects and the tasks you want to run:
./gradlew bson-kotlin:test bson-kotlinx:test driver-kotlin-sync:test driver-kotlin-sync:integrationTest ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think 2 is more explicit/readable about what we want to test 👍


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}
2 changes: 1 addition & 1 deletion .evergreen/static-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 0 additions & 7 deletions bson-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,6 @@ spotbugs { showProgress.set(true) }
// ===========================
// Test Configuration
// ===========================
tasks.create("kotlinCheck") {
description = "Runs all the kotlin checks"
group = "verification"

dependsOn("clean", "check")
tasks.findByName("check")?.mustRunAfter("clean")
}

tasks.test { useJUnitPlatform() }

Expand Down
7 changes: 0 additions & 7 deletions bson-kotlinx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,6 @@ spotbugs { showProgress.set(true) }
// ===========================
// Test Configuration
// ===========================
tasks.create("kotlinCheck") {
description = "Runs all the kotlin checks"
group = "verification"

dependsOn("clean", "check")
tasks.findByName("check")?.mustRunAfter("clean")
}

tasks.test { useJUnitPlatform() }

Expand Down
9 changes: 0 additions & 9 deletions driver-kotlin-coroutine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,6 @@ val integrationTest =
classpath = sourceSets["integrationTest"].runtimeClasspath
}

tasks.create("kotlinCheck") {
description = "Runs all the kotlin checks"
group = "verification"

dependsOn("clean", "check", integrationTest)
tasks.findByName("check")?.mustRunAfter("clean")
tasks.findByName("integrationTest")?.mustRunAfter("check")
}

tasks.test { useJUnitPlatform() }

// ===========================
Expand Down
8 changes: 0 additions & 8 deletions driver-kotlin-extensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ tasks.spotbugsMain {
// Test Configuration
// ===========================

tasks.create("kotlinCheck") {
description = "Runs all the kotlin checks"
group = "verification"

dependsOn("clean", "check")
tasks.findByName("check")?.mustRunAfter("clean")
}

tasks.test { useJUnitPlatform() }

// ===========================
Expand Down
9 changes: 0 additions & 9 deletions driver-kotlin-sync/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,6 @@ val integrationTest =
classpath = sourceSets["integrationTest"].runtimeClasspath
}

tasks.create("kotlinCheck") {
description = "Runs all the kotlin checks"
group = "verification"

dependsOn("clean", "check", integrationTest)
tasks.findByName("check")?.mustRunAfter("clean")
tasks.findByName("integrationTest")?.mustRunAfter("check")
}

tasks.test { useJUnitPlatform() }

// ===========================
Expand Down