Open Bug 1544496 Opened 3 years ago Updated 2 years ago

geckoview gtest pushes libxul.so to application directory

Categories

(GeckoView :: General, defect, P3)

Unspecified
Android
defect

Tracking

(firefox68 affected)

Tracking Status
firefox68 --- affected

People

(Reporter: gbrown, Unassigned)

References

Details

Bug 1318091 has enabled gtest on Android, running in the geckoview TestRunnerActivity.

gtest compiles tests into gtest/libxul.so, which is not currently included in any apk. Currently the android gtest harness installs the TRA apk with the normal, non-test libxul.so, then over-writes the installed libxul.so with gtest/libxul.so. That works in the well-controlled environment of continuous integration, but is otherwise quite fragile. Also, it assumes a root shell -- okay for the emulator, but problematic for tests on local devices, or even the android-hw test devices.

Would it make sense to have gtest/libxul.so included in the TRA apk? Create a separate apk for gtest??

See:

https://searchfox.org/mozilla-central/rev/1b2636e8517aa48422ed516affe4d28cb7fa220a/testing/gtest/remotegtests.py#74-76

Blocks: 1318091
No longer depends on: 1318091
OS: All → Android
Priority: -- → P3
See Also: → 1550052

:nalexander - Do you have an idea of how to solve this? Do you have time to look into it??

Flags: needinfo?(nalexander)

(In reply to Geoff Brown [:gbrown] from comment #1)

:nalexander - Do you have an idea of how to solve this? Do you have time to look into it??

I haven't much time to address this directly, but I can certainly provide some guidance.

A separate APK for gtest definitely is the most appealing: I'm leery of trying to override the location of libxul.so conditionally. But a quick skim of the sources suggest it wouldn't be too hard: look for some gtest-specific environment variable here.

Arranging a separate APK is not hard, per se, but it's a burden: we'd need to make the geckoview Gradle project have a test APK for some product flavor that includes gtest. We're trying to minimize product flavors, which is in conflict with separate APKs.

So I suggest:

If you explain how the gtest/libxul.so gets produced I can help with the first step. I don't have a compiled objdir right now (really, ever) so I can't just see myself. Can I get these things from artifacts in some way, so that we can make this possible with an artifact build?

Flags: needinfo?(nalexander) → needinfo?(gbrown)

Thanks Nick!

The gtest harness sets various environment variables already, https://searchfox.org/mozilla-central/rev/b9da45f63cb567244933c77b2c7e827a057d3f9b/testing/gtest/remotegtests.py#43.

For local runs, gtest/libxul.so usually gets built via the gtest mach command: https://searchfox.org/mozilla-central/rev/b9da45f63cb567244933c77b2c7e827a057d3f9b/python/mozbuild/mozbuild/mach_commands.py#639-646

In CI, gtest/libxul.so gets built into the target.gtest.tests.tar.gz artifact; I don't know much about how that comes about.

Flags: needinfo?(gbrown)
Blocks: 1558885
You need to log in before you can comment on or make changes to this bug.