Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No tests found when using ANDROIDX_TEST_ORCHESTRATOR

When I have ANDROIDX_TEST_ORCHESTRATOR in testOptions

testOptions {
    unitTests.includeAndroidResources = true
    animationsDisabled = true
    execution 'ANDROIDX_TEST_ORCHESTRATOR'
}

and I run the instrumented test

./gradlew connectedStudioDebugAndroidTest --stacktrace

I get error that tests are not found

com.android.builder.testing.ConnectedDevice > No tests found.[emu1(AVD) - 9] FAILED 
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack @Test annotations).

and when I comment out ANDROIDX_TEST_ORCHESTRATOR in testOptions

testOptions {
    unitTests.includeAndroidResources = true
    animationsDisabled = true
    // execution 'ANDROIDX_TEST_ORCHESTRATOR'
}

the tests run.

So how can I get tests to run with ANDROIDX_TEST_ORCHESTRATOR?

edit

I made some progress: the androidTests run on my real device (API 28) but not any emulator (API 28). I'm on OSX btw.

like image 557
the_prole Avatar asked Jun 15 '20 19:06

the_prole


1 Answers

This seems to be a bug in ANDROIDX_TEST_ORCHESTRATOR version 1.2.0 and older.

I got it to work by bumping the version to 1.3.0-rc01 in the dependencies in the build.gradle file.

androidTestUtil 'androidx.test:orchestrator:1.3.0-rc01'
like image 184
bruno_eiterer Avatar answered Sep 18 '22 16:09

bruno_eiterer