geckoview gtest pushes libxul.so to application directory
Categories
(GeckoView :: General, defect, P3)
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:
Updated•5 years ago
|
Reporter | ||
Comment 1•5 years ago
|
||
:nalexander - Do you have an idea of how to solve this? Do you have time to look into it??
Comment 2•5 years ago
|
||
(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:
- monkeying with https://searchfox.org/mozilla-central/source/mobile/android/gradle/with_gecko_binaries.gradle#42 to include this gtest/libxul.so
- it might be easiest to make that
gtest_libxul.so
rather than a subdirectory - teaching APKOpen to load the libxul you want based on an environment variable
- setting the environment variable in the harness
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?
Reporter | ||
Comment 3•5 years ago
|
||
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.
Updated•2 years ago
|
Description
•