Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/android_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
run: chmod +x ./gradlew

- name: Run unit tests
run: ./gradlew test
run: ./gradlew test -PrunTests
17 changes: 17 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,20 @@ dependencies {
testImplementation 'org.mockito:mockito-core:3.8.0'
testImplementation 'org.mockito:mockito-inline:3.8.0'
}

afterEvaluate {
// Disable running tests automatically unless explicitly enabled
tasks.matching { it.name.startsWith("test") }.configureEach {
onlyIf { project.hasProperty("runTests") }
}

// Optionally ensure the build task itself doesn’t depend on tests
def buildTask = tasks.findByName("build")
if (buildTask != null) {
// Filter out any "test*" dependencies safely
buildTask.dependsOn = buildTask.dependsOn.findAll { dep ->
!(dep instanceof String && dep.startsWith("test")) &&
!(dep instanceof Task && dep.name.startsWith("test"))
}
}
}