Taskcluster: test in Android emulator

This commit is contained in:
Simon Sapin 2018-10-10 20:53:17 +02:00
parent 556435ae01
commit f357c6fe93
4 changed files with 42 additions and 1 deletions

View file

@ -27,8 +27,10 @@ tasks:
# Granted to role "repo:github.com/servo/servo:branch:*"
- "queue:create-task:highest:aws-provisioner-v1/servo-*"
- "queue:create-task:highest:proj-servo/*"
- "queue:route:index.project.servo.servo.*"
- "docker-worker:cache:servo-*"
- "docker-worker:capability:privileged"
payload:
maxRunTime: {$eval: '20 * 60'}

View file

@ -94,7 +94,7 @@ def android_arm32():
def android_x86():
return (
build_task = (
android_build_task("Android x86: release build")
.with_script("./mach build --target i686-linux-android --release")
.with_artifacts(
@ -103,6 +103,30 @@ def android_x86():
)
.find_or_create("build.android_x86_release." + CONFIG.git_sha)
)
return (
DockerWorkerTask("Android x86: tests in emulator")
.with_provisioner_id("proj-servo")
.with_worker_type("docker-worker-kvm")
.with_capabilities(privileged=True)
.with_scopes("project:servo:docker-worker-kvm:capability:privileged")
.with_dockerfile(dockerfile_path("run-android-emulator"))
.with_dependencies(build_task)
.with_env(BUILD_TASK_ID=build_task)
.with_repo()
.with_script("""
mkdir -p target/i686-linux-android/release/
./etc/taskcluster/curl-artifact.sh ${BUILD_TASK_ID} servoapp.apk \
-o target/i686-linux-android/release/servoapp.apk
./mach bootstrap-android --accept-all-licences --emulator-x86
./mach test-android-startup --release
./mach test-wpt-android --release \
/_mozilla/mozilla/DOMParser.html \
/_mozilla/mozilla/webgl/context_creation_error.html
""")
.create()
)
def windows_dev():
@ -199,6 +223,7 @@ def linux_run_task(name, build_task, script):
return (
linux_task(name)
.with_dockerfile(dockerfile_path("run"))
.with_repo()
.with_early_script("""
./etc/taskcluster/curl-artifact.sh ${BUILD_TASK_ID} target.tar.gz | tar -xz
""")

View file

@ -512,6 +512,7 @@ class DockerWorkerTask(Task):
self.env = {}
self.caches = {}
self.features = {}
self.capabilities = {}
self.artifacts = []
with_docker_image = chaining(setattr, "docker_image")
@ -521,6 +522,7 @@ class DockerWorkerTask(Task):
with_early_script = chaining(prepend_to_attr, "scripts")
with_caches = chaining(update_attr, "caches")
with_env = chaining(update_attr, "env")
with_capabilities = chaining(update_attr, "capabilities")
def build_worker_payload(self):
"""
@ -541,6 +543,7 @@ class DockerWorkerTask(Task):
env=self.env,
cache=self.caches,
features=self.features,
capabilities=self.capabilities,
artifacts={
"public/" + url_basename(path): {
"type": "file",

View file

@ -0,0 +1,11 @@
% include base.dockerfile
RUN \
apt-get install -qy --no-install-recommends \
#
# Multiple Android-related tools are in Java
openjdk-8-jdk-headless \
#
# Emulator dependencies
libgl1 \
libpulse0