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

Initial support for running with android emulator #18406

Merged
merged 6 commits into from Sep 5, 2019
Merged

Conversation

jgraham
Copy link
Contributor

@jgraham jgraham commented Aug 13, 2019

This enables wpt run firefox-android <path> in the x86_64 emulator. Most of the settings are taken from gecko, so it won't yet generalise to other products (unless they want to use the same configuration), but it's a start to get our android support into a better shape.

@jgraham jgraham requested review from Hexcles and mjzffr August 13, 2019 19:11
@wpt-pr-bot wpt-pr-bot added infra third_party wpt wptrunner The automated test runner, commonly called through ./wpt run labels Aug 13, 2019
This is used by mozilla to download static artifacts required in automation.
We want it here to download the NVD files for android tests.
@@ -0,0 +1,10 @@
[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions about this mostly because of my lack of familiarity and confusion around the terminologies:

  • IIUC, this file is downloaded from or using mach/tooltool? If so, why is that? Does the official SDK not provide a command line to download and verify AVDs? If not, perhaps we should rename the file to android-emulator.manifest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I assume this would only work on Linux? And does the host have to 32-bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't know anything about this either. I just know that these are the NVDs that gecko uses in automation, but I haven't got as far as digging into the content to work out why they're special.

tools/wpt/android.py Show resolved Hide resolved
dest = os.pwd

TC_QUEUE_BASE = "https://queue.taskcluster.net/v1/"
TC_INDEX_BASE = "https://index.taskcluster.net/v1/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this will be the first dependency on Taskcluster domain in this repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's not ideal. If I find somewhere else that this is mirrored to I'll use that instead.

This is a precusrsor to allowing local testing in emulated andrid
devices. It adds install-android-emulator and start-android-emulator
commands that ensure that the emulator is present and start it,
respectively.

The settings are so far just copied from what gecko does; it's assumed
that much of this will need to be configurable in the future.
This is very basic support for running Firefox tests in an
emulator. The actual app used is by default the geckoview test apk
which matches what gecko does in CI.

Because the startup sequence for android is a little different from
desktop browsers the division of labour in run.py between install and
setup_kwargs is a little wonky; we can't install until a device is
connected or the emulator is started, and knowing that requires
setting the kwargs. So the initial cut at this just makes install()
record some state that we inspect in setup_kwargs to indicate whether
we should go ahead and run the install.

The actual apk we install is just the latest build from
mozilla-central which is pretty close to "latest nightly". It might be
possible to do better here and get the actual latest nightly.
There isn't a way to make this work on CI until we can run
in priviledged mode or similar, giving kvm access. Just
skip for now.
@jgraham
Copy link
Contributor Author

jgraham commented Aug 15, 2019

So this is enough for me to run it locally. I've had to disable the tests in CI because in docker it wants access to kvm, which requires --priviledged and isn't possible on TaskCluster (using the workers available to us at present). Locally under docker I also had some problems since running with -gpu on failed due to the lack of GPU and -gpu off caused the test app to crash on startup.

I know the current state of this isn't perfect, but I'm inclined to request that we take the attitude that we'll fix some of the issues as we get CI support and support for other browsers; I don't want to spend too much time predicting what's required there since we'll find out soon enough.

@jgraham jgraham requested a review from mjzffr September 5, 2019 18:00
Copy link
Contributor

@mjzffr mjzffr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly an Android automation expert, but the bits I'm familiar with look reasonable (i.e. they look similar enough to the tools I've hacked on in mozilla-central)

Copy link
Member

@Hexcles Hexcles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

locales \
openjdk-8-jre-headless \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: does the SDK require JDK 8? Can we use the generic/versionless package to be more future-proof?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be nice, wouldn't it. Unfortuantely until I used this older version I was getting some mysterious failures, so I think it's really required.

@jgraham jgraham merged commit a4a77d8 into master Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker infra third_party wpt wptrunner The automated test runner, commonly called through ./wpt run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants