Android Virtual Device Testing: Not running UI tests for all modules

Bitrise Build Issue Report template

Description of the issue

I have Virtual Device Testing set up in my build. It only runs the one example test in one of my modules, and not the other tests in my main app module.

Environment:

Where did the issue happen?

Bitrise.io, Android & Docker, on Ubuntu 16.04

Which build Step causes the issue and which version of the step?

Virtual Device Testing for Android 1.0.1

Reproducibility

  • _Does a “Rebuild” help? NO
  • Does the issue happen sporadically, or every time? : Every time
  • Does upgrading the build Step to the latest version help? : Already on latest
  • When did the issue start? : Since I enabled testing

Build log

https://www.bitrise.io/build/b38865b45967d86e

Hi it seems the provided gradle tasks: assembleDebug assembleDebugAndroidTest

are building multiple apks:

copy ./app/build/outputs/apk/standalone/debug/app-standalone-debug.apk to /bitrise/deploy/app-standalone-debug.apk
copy ./app/build/outputs/apk/mhealth/debug/app-mhealth-debug.apk to /bitrise/deploy/app-mhealth-debug.apk

There are also other apks which i guess are stored in your repo. The step expot’s the last apk into the BITRISE_APK_PATH env, in your case this is the one, with version 1.0.4.

The same is true for the test apks, the last one is exported in your case: android-module-soundmonitor-debug-androidTest.apk.

So the test runs the android-module-soundmonitor-debug-androidTest.apk against the 1.0.4 version apk.

Use the gradle-runner step’s ApkFileIncludeFilter to control which apk to export and use the ApkFileExcludeFilter to control which test apk to export.

1 Like

Thanks, I think I made progress (I managed to get rid of the sub module APKs) but it seems like it is not building the test APK for the app module…
Issue with TestApkPath: parameter not specified

https://www.bitrise.io/build/8b5c1c7999b66241

You have right based on your build log.

That can be because you did not set the gradle task which would build your app module’s test apk.

The step logs the gradle calls we use to build your project. So please call that commands in your local machine and please do check if the desired apk is generated by these tasks: assembleDebug assembleDebugAndroidTest.

If not you should find the correct task, you can list the tasks, by running: ./gradlew tasks in your project’s directory.

1 Like

Thanks! Finally got it working. Instead of assembleDebugAndroidTest I had to use assembleAndroidTest

1 Like

Good catch, thanks for reporting @hendrep! :slight_smile: