Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ignoring the debug/release distinction#250

Answeredbyio7m
io7m asked this question inQ&A
Discussion options

Hello!

In our apps, we don't use a debug/release distinction (we're open source software, everyone runs identical code, there are no "debug" or "release" builds). Unfortunately, the Android ecosystem imposes the distinction upon us, and so a command like this:

$ ./gradlew clean assemble test

... Will actually run the test suite twice; once in "debug" and once in "release". For some of our long running test suites, this is annoying and redundant.

Is there a simple way toonly run the test suite once? My thinking is that some combination of release and debug test filters should be able to do it, but I can't seem to come up with the right combination.

Edit:

To clarify, we like having a single well-known command such as:

$ ./gradlew clean assemble test

Because this has the same interface regardless of whether the project is an Android project or a plain Java or Kotlin project. We don't want to have to use something like:

$ ./gradlew clean assembleDebug testDebug

... Because those tasks are Android-specific. I'd like to make thetest task do the right thing all the time.

You must be logged in to vote
Answered by io7mMay 13, 2021

The most obvious solution (which I thought I tried first!) actually seems to handle this properly after all:

testOptions {  junitPlatform {    releaseFilters {      excludePattern "**/**"    }  }}

The build results in atestDebugUnitTest directory showing test executions, and notestReleaseUnitTest. 🎉

Replies: 1 comment

Comment options

The most obvious solution (which I thought I tried first!) actually seems to handle this properly after all:

testOptions {  junitPlatform {    releaseFilters {      excludePattern "**/**"    }  }}

The build results in atestDebugUnitTest directory showing test executions, and notestReleaseUnitTest. 🎉

You must be logged in to vote
0 replies
Answer selected byio7m
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@io7m

[8]ページ先頭

©2009-2025 Movatter.jp