Skip to content

Android Library seemingly can't filter Instrumented tests via @Tag #174

@ktkopone

Description

@ktkopone

I'm trying to prototype a simple Hello World gradle android library project to get the @Tag filtering working with some tests. After some amount of hunting around, I got this working with unit tests (though as an aside, https://github.com/mannodermaus/android-junit5/wiki/Migrating-from-1.0.x is a bit obscure and should probably be pulled into the main wiki pages, e.g. android.testOptions.junitPlatform.filters.tags.include having been moved to <...>.filters.includeTags was a pain point). Thus running e.g. ./gradlew clean test is now successfully only running tests tagged with @Tag('sampleTag').

However, instrumentation tests are still all being run regardless of the filter, e.g. ./gradlew clean connectedAndroidTest runs both tests regardless of the @Tag('sampleTag')

The following is my build.grade:

build.gradle.txt

and my project is laid out with unit tests in src/test/java and instrumentation tests in src/androidTest/java. This is the current instrumentation test file I'm running:

StupidConnectedTest.java.txt

Is this not currently supported, or am I missing some separate place where filters on instrumentation tests need to be defined, or a gradle dependency, etc?

Please and thanks for any help!

EDIT: Sorry Tom g, didn't mean to tag you.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions