Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An ability to run tests on Android emulator #2450

Open
Augustyniak opened this issue Aug 2, 2022 · 1 comment
Open

An ability to run tests on Android emulator #2450

Augustyniak opened this issue Aug 2, 2022 · 1 comment
Assignees

Comments

@Augustyniak
Copy link
Contributor

Add a support for running Android tests on Android emulator to properly test all code that runs when Envoy Mobile runs on real Android devices.

Some of the code that's executed when Envoy Mobile runs on Android is hidden behind a compiler flag check that looks as follow: #if defined(__ANDROID_API__). For example:

#if defined(__ANDROID_API__)

To properly test this code Envoy Mobile has to be build under android cc tool chain and the app (or test host) has to run on an emulator or a real device. As of now, there are no option to run tests like this in Envoy Mobile repo. Since testing of such code is impossible it's currently untested which leads to issues like #2432.

On the surface it seems that we could add support for running Android tests on emulator by using android_instrumentation_test macro that's documented in here. There is a GH issue bazelbuild/bazel#7069 which seems to suggest that this specific bazel macro does not currently work on macOS. That should not be a problem if we are OK with running these tests on Linux machine.

@Augustyniak
Copy link
Contributor Author

We talked with @jpsim and Lyft client tooling folks to see what the next steps here could be. A few updates/notes from what we talked about and eventually decided on:

  • we decided not to go with android_instrumentation_test macro. It not working on mac os being one of the reasons.
  • we are planning to have a setup that's similar to our set up for running Envoy Mobile example apps. We will write custom scripts for compiling test files as part of a test example app that will be then run on an actual Android emulator. There are some concerns here related to state sharing between different tests (we would like tests to be isolated from each other) and the ability to use Android testing framework when our tests are compiled as part of a 'normal' Android app/target (and not a special testing one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants