Repository navigation
Conversation
`./gradlew :app:testDebugUnitTest` and `./gradlew connectedDebugAndroidTest` run an Android project's unit and instrumented tests, but the Gradle pattern took only a task named `test`, so every turn in an Android repository read as one with no verification at all. `testClasses`, `compileDebugUnitTestKotlin` and `-x testDebugUnitTest` still run no tests.
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An Android project runs its tests through the Android Gradle plugin's variant tasks:
./gradlew :app:testDebugUnitTestfor the unit tests (onetest<Variant>UnitTestper build variant, such astestFreeReleaseUnitTest) and./gradlew connectedAndroidTestor:app:connectedDebugAndroidTestfor the instrumented ones. The Gradle alternative ofVERIFY_RE(#284) takes only a task namedtest, sostatus_of_testsreturned None for every one of them: in an Android repository no turn had a verification, and a failing run after the last edit left the turn counted as ended green.Fix: after the optional subproject path, the task may also be
test…UnitTestorconnected…AndroidTest. Tasks that run no tests stay non-runs:testClasses,compileDebugUnitTestKotlin,assembleDebugAndroidTest, and a variant test task left out with-x(./gradlew build -x testDebugUnitTest).Tests, in
tests/test_loopguard_jvm_builds.py:RUNS, each a verification, and a failing run after an edit is not ended green; all 5 fail on main;NOT_RUNS.