tree: f031d131e397041247025c997d24d01628ccc9fc [path history] [tgz]
  1. app/
  2. .gitignore
  3. BUILD.gn
  4. build.gradle
  5. buildscript-gradle.lockfile
  6. expected_golden_output.txt
  7. gradle.properties
  8. README.md
  9. settings.gradle
testing/scenario_app/android/README.md

Scenario App: Android Tests

As mentioned in the top-level README, this directory contains the Android-specific native code and tests for the scenario app. To run the tests, you will need to build the engine with the appropriate configuration.

For example, for the latest android build you've made locally:

dart ./testing/scenario_app/bin/run_android_tests.dart

Or for a specific, build, such as android_debug_unopt_arm64:

dart ./testing/scenario_app/bin/run_android_tests.dart --out-dir=../out/android_debug_unopt_arm64

Debugging

Debugging the tests on CI is not straightforward but is being improved:

Locally (or on a temporary PR for CI), you can run the tests with the --smoke-test argument to run a single test by class name, which can be useful to verify the setup:

dart ./testing/scenario_app/bin/run_android_tests.dart --smoke-test dev.flutter.scenarios.EngineLaunchE2ETest

The result of adb logcat and screenshots taken during the test will be stored in a logs directory, which is either FLUTTER_LOGS_DIR (if set, such as on CI) or locally in out/.../scenario_app/logs.

You can then view the logs and screenshots on LUCI. For example:

Screenshot of the Logs on LUCI.

CI Configuration

See ci/builders/linux_android_emulator.json , and grep for run_android_tests.dart.

The following matrix of configurations is tested on the CI:

API VersionGraphics BackendSkia GoldRationale
34SkiaAndroid 34 + SkiaNewer Android devices on Skia.
34Impeller (OpenGLES)Android 34 + Impeller OpenGLESNewer Android devices on Impeller with OpenGLES.
34Impeller (Vulkan)Android 34 + Impeller VulkanNewer Android devices on Impeller.

Updating Gradle dependencies

See Updating the Embedding Dependencies.

Output validation

The generated output will be checked against a golden file (expected_golden_output.txt) to make sure all output was generated. A patch will be printed to stdout if they don't match.