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
Conversation
This is used by mozilla to download static artifacts required in automation. We want it here to download the NVD files for android tests.
33bb21e
to
800cda8
Compare
@@ -0,0 +1,10 @@ | |||
[ |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
dest = os.pwd | ||
|
||
TC_QUEUE_BASE = "https://queue.taskcluster.net/v1/" | ||
TC_INDEX_BASE = "https://index.taskcluster.net/v1/" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
800cda8
to
2d07d76
Compare
a2ade50
to
43ac153
Compare
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.
f552cda
to
bb6f9cf
Compare
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 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. |
There was a problem hiding this 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)
There was a problem hiding this 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 \ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.