This repository shows how you can severely reduce the time taken to run instrumentation tests on cloud-based app-testing infrastructure like Firebase test lab. It forks an Android testing codelab to act as a sample project to show a demo.
The idea is simply based on:
- Importing an annotation processor, in your project, which creates a file with the full names of all the instrumentation test cases at the build time.
- Run a bash script which executes those tests concurrently on Firebase test lab.
These are the steps to to integrate the tweak to the sample project Android testing codelab:
- Import the annotation processor module as shown in this commit.
- Add these bash scripts to the root of the project.
- Uncomment this bash code after doing the necessary substitution.
- Make sure you have configured local gcloud sdk environment.
- Execute the following bash code in the project root directory:
./gradlew clean
./gradlew assembleMockDebug # builds app APK
./gradlew assembleMockDebugAndroidTest # builds ui-test APK and generates "ui-tests" file
bash firebase-run-tests-concurrently.sh ui-tests