Bug 1294234 - Use run-task for test tasks; r=dustin
☠☠ backed out by b17f42ecbc3c ☠ ☠
authorGregory Szorc <gps@mozilla.com>
Tue, 09 Aug 2016 14:34:58 -0700
changeset 309294 25bc6ca8f19ffb1c8419fe441c341202991bb85c
parent 309293 c72df0f64a7f221f67205aba1d6321f4365ccf5a
child 309295 913802fd98ec25a7a36bb80253cbb1af108c70fb
push id30560
push userkwierso@gmail.com
push dateMon, 15 Aug 2016 21:07:46 +0000
treeherdermozilla-central@7b74ee1d97db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1294234
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1294234 - Use run-task for test tasks; r=dustin Before, test.sh (duplicated between the desktop-test and desktop1604-test images) was dropping permissions, creating a workspace, and executing test-linux.sh. This is functionality now provided by run-task. So, convert the test tasks to use run-task. One thing run-task isn't doing is created the workspace. So this functionality has been moved into test-ubuntu1204.sh and test-ubuntu1604.sh. Since the test.sh files are no longer used after this change, they have been deleted. The desktop-test image no longer has any files in the bin/ directory, so the Dockerfile entry to copy those files has been removed. MozReview-Commit-ID: 1BiskrMs6xW
taskcluster/scripts/tester/test-ubuntu1204.sh
taskcluster/scripts/tester/test-ubuntu1604.sh
taskcluster/taskgraph/transforms/tests/make_task_description.py
testing/docker/desktop-test/Dockerfile
testing/docker/desktop-test/bin/test.sh
testing/docker/desktop1604-test/bin/test.sh
--- a/taskcluster/scripts/tester/test-ubuntu1204.sh
+++ b/taskcluster/scripts/tester/test-ubuntu1204.sh
@@ -17,17 +17,19 @@ echo "running as" $(id)
 : NEED_WINDOW_MANAGER           ${NEED_WINDOW_MANAGER:=false}
 : NEED_PULSEAUDIO               ${NEED_PULSEAUDIO:=false}
 : START_VNC                     ${START_VNC:=false}
 : TASKCLUSTER_INTERACTIVE       ${TASKCLUSTER_INTERACTIVE:=false}
 : WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
 : mozharness args               "${@}"
 
 set -v
-cd $WORKSPACE
+
+mkdir -p ${WORKSPACE}
+cd ${WORKSPACE}
 
 fail() {
     echo # make sure error message is on a new line
     echo "[test-linux.sh:error]" "${@}"
     exit 1
 }
 
 # test required parameters are supplied
--- a/taskcluster/scripts/tester/test-ubuntu1604.sh
+++ b/taskcluster/scripts/tester/test-ubuntu1604.sh
@@ -17,17 +17,19 @@ echo "running as" $(id)
 : NEED_WINDOW_MANAGER           ${NEED_WINDOW_MANAGER:=false}
 : NEED_PULSEAUDIO               ${NEED_PULSEAUDIO:=false}
 : START_VNC                     ${START_VNC:=false}
 : TASKCLUSTER_INTERACTIVE       ${TASKCLUSTER_INTERACTIVE:=false}
 : WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
 : mozharness args               "${@}"
 
 set -v
-cd $WORKSPACE
+
+mkdir -p ${WORKSPACE}
+cd ${WORKSPACE}
 
 fail() {
     echo # make sure error message is on a new line
     echo "[test-linux.sh:error]" "${@}"
     exit 1
 }
 
 # test required parameters are supplied
--- a/taskcluster/taskgraph/transforms/tests/make_task_description.py
+++ b/taskcluster/taskgraph/transforms/tests/make_task_description.py
@@ -187,18 +187,22 @@ def docker_worker_setup(config, test, ta
             'mount-point': '/home/worker/tooltool-cache',
         })
         taskdesc['scopes'].extend([
             'docker-worker:relengapi-proxy:tooltool.download.internal',
             'docker-worker:relengapi-proxy:tooltool.download.public',
         ])
 
     # assemble the command line
+    command = [
+        '/home/worker/bin/run-task',
+        '--',
+        '/home/worker/bin/test-linux.sh',
+    ]
 
-    command = ["bash", "/home/worker/bin/test.sh"]
     if mozharness.get('no-read-buildbot-config'):
         command.append("--no-read-buildbot-config")
     command.extend([
         {"task-reference": "--installer-url=" + installer_url},
         {"task-reference": "--test-packages-url=" + test_packages_url},
     ])
     command.extend(mozharness.get('extra-options', []))
 
--- a/testing/docker/desktop-test/Dockerfile
+++ b/testing/docker/desktop-test/Dockerfile
@@ -33,17 +33,16 @@ ENV           USER          worker
 ENV           LOGNAME       worker
 ENV           HOSTNAME      taskcluster-worker
 ENV           LANG          en_US.UTF-8
 ENV           LC_ALL        en_US.UTF-8
 
 # Add utilities and configuration
 COPY           dot-files/config              /home/worker/.config
 COPY           dot-files/pulse               /home/worker/.pulse
-COPY           bin                           /home/worker/bin
 RUN            chmod +x bin/*
 # TODO: remove this when buildbot is gone
 COPY           buildprops.json               /home/worker/buildprops.json
 COPY           tc-vcs-config.yml /etc/taskcluster-vcs.yml
 
 # TODO: remove
 ADD            https://raw.githubusercontent.com/taskcluster/buildbot-step/master/buildbot_step /home/worker/bin/buildbot_step
 RUN chmod u+x /home/worker/bin/buildbot_step
deleted file mode 100644
--- a/testing/docker/desktop-test/bin/test.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /bin/bash -vex
-
-set -x -e
-
-: GECKO_HEAD_REPOSITORY         ${GECKO_HEAD_REPOSITORY:=https://hg.mozilla.org/mozilla-central}
-: GECKO_HEAD_REV                ${GECKO_HEAD_REV:=default}
-: WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
-
-
-# TODO: when bug 1093833 is solved and tasks can run as non-root, reduce this
-# to a simple fail-if-root check
-if [ $(id -u) = 0 ]; then
-    chown -R worker:worker /home/worker
-    # drop privileges by re-running this script
-    exec sudo -E -u worker bash /home/worker/bin/test.sh "${@}"
-fi
-
-[ -d $WORKSPACE ] || mkdir -p $WORKSPACE
-cd $WORKSPACE
-exec /home/worker/bin/test-linux.sh "${@}"
deleted file mode 100644
--- a/testing/docker/desktop1604-test/bin/test.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /bin/bash -vex
-
-set -x -e
-
-: GECKO_HEAD_REPOSITORY         ${GECKO_HEAD_REPOSITORY:=https://hg.mozilla.org/mozilla-central}
-: GECKO_HEAD_REV                ${GECKO_HEAD_REV:=default}
-: WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
-
-
-# TODO: when bug 1093833 is solved and tasks can run as non-root, reduce this
-# to a simple fail-if-root check
-if [ $(id -u) = 0 ]; then
-    chown -R worker:worker /home/worker
-    # drop privileges by re-running this script
-    exec sudo -E -u worker bash /home/worker/bin/test.sh "${@}"
-fi
-
-[ -d $WORKSPACE ] || mkdir -p $WORKSPACE
-cd $WORKSPACE
-exec /home/worker/bin/test-linux.sh "${@}"