Bug 1302907 - Merge test-ubuntu1204.sh and test-ubuntu1604.sh; r=dustin
☠☠ backed out by 9b42d4b1f448 ☠ ☠
authorGregory Szorc <gps@mozilla.com>
Wed, 14 Sep 2016 16:29:25 -0700
changeset 355305 f227ea4d52fed84e3e682de0aa4cb8869539d645
parent 355304 d41128490bb70045b36caab39239011621b94728
child 355306 11ffdc56f5becfeb2ee03423f67749f4baf1f3a7
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1302907
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 1302907 - Merge test-ubuntu1204.sh and test-ubuntu1604.sh; r=dustin The only difference in these files was the order that pulseaudio is started and whether compiz is started. We rename test-ubuntu1604.sh to test-ubuntu.sh, add some distro release detection, and add some conditional branches so it works on both Ubuntu 12.04 and 16.04. MozReview-Commit-ID: CaSfuDxss3d
taskcluster/scripts/tester/test-ubuntu.sh
taskcluster/scripts/tester/test-ubuntu1204.sh
taskcluster/scripts/tester/test-ubuntu1604.sh
testing/docker/desktop-test/Dockerfile
testing/docker/desktop1604-test/Dockerfile
rename from taskcluster/scripts/tester/test-ubuntu1604.sh
rename to taskcluster/scripts/tester/test-ubuntu.sh
--- a/taskcluster/scripts/tester/test-ubuntu1604.sh
+++ b/taskcluster/scripts/tester/test-ubuntu.sh
@@ -1,14 +1,22 @@
 #! /bin/bash -xe
 
 set -x -e
 
 echo "running as" $(id)
 
+# Detect release version.
+. /etc/lsb-release
+if [ "${DISTRIB_RELEASE}" == "12.04" ]; then
+    UBUNTU_1204=1
+elif [ "${DISTRIB_RELEASE}" == "16.04" ]; then
+    UBUNTU_1601=1
+fi
+
 . /home/worker/scripts/xvfb.sh
 
 ####
 # Taskcluster friendly wrapper for performing fx desktop tests via mozharness.
 ####
 
 # Inputs, with defaults
 
@@ -27,16 +35,23 @@ set -v
 cd $WORKSPACE
 
 fail() {
     echo # make sure error message is on a new line
     echo "[test-linux.sh:error]" "${@}"
     exit 1
 }
 
+maybe_start_pulse() {
+    if $NEED_PULSEAUDIO; then
+        pulseaudio --fail --daemonize --start
+        pactl load-module module-null-sink
+    fi
+}
+
 # test required parameters are supplied
 if [[ -z ${MOZHARNESS_URL} ]]; then fail "MOZHARNESS_URL is not set"; fi
 if [[ -z ${MOZHARNESS_SCRIPT} ]]; then fail "MOZHARNESS_SCRIPT is not set"; fi
 if [[ -z ${MOZHARNESS_CONFIG} ]]; then fail "MOZHARNESS_CONFIG is not set"; fi
 
 mkdir -p ~/artifacts/public
 
 cleanup() {
@@ -57,16 +72,21 @@ fi
 rm -rf mozharness
 unzip -q mozharness.zip
 rm mozharness.zip
 
 if ! [ -d mozharness ]; then
     fail "mozharness zip did not contain mozharness/"
 fi
 
+# pulseaudio daemon must be started before xvfb on Ubuntu 12.04.
+if ${UBUNTU_1204}; then
+    maybe_start_pulse
+fi
+
 # run XVfb in the background, if necessary
 if $NEED_XVFB; then
     start_xvfb '1600x1200x24' 0
 fi
 
 if $START_VNC; then
     x11vnc > ~/artifacts/public/x11vnc.log 2>&1 &
 fi
@@ -85,27 +105,25 @@ if $NEED_WINDOW_MANAGER; then
 
     # Turn off the screen saver and screen locking
     gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
     gsettings set org.gnome.desktop.screensaver lock-enabled false
     gsettings set org.gnome.desktop.screensaver lock-delay 3600
     # Disable the screen saver
     xset s off s reset
 
-    # start compiz for our window manager
-    compiz 2>&1 &
-
-    #TODO: how to determine if compiz starts correctly?
+    if ${UBUNTU_1604}; then
+        # start compiz for our window manager
+        compiz 2>&1 &
+        #TODO: how to determine if compiz starts correctly?
+    fi
 fi
 
-# start up the pulseaudio daemon.  Note that it's important this occur
-# before the Xvfb startup for ubuntu 12.04, not for 16.04
-if $NEED_PULSEAUDIO; then
-    pulseaudio --fail --daemonize --start
-    pactl load-module module-null-sink
+if ${UBUNTU_1604}; then
+    maybe_start_pulse
 fi
 
 # For telemetry purposes, the build process wants information about the
 # source it is running; tc-vcs obscures this a little, but we can provide
 # it directly.
 export MOZ_SOURCE_REPO="${GECKO_HEAD_REPOSITORY}"
 export MOZ_SOURCE_CHANGESET="${GECKO_HEAD_REV}"
 
deleted file mode 100644
--- a/taskcluster/scripts/tester/test-ubuntu1204.sh
+++ /dev/null
@@ -1,131 +0,0 @@
-#! /bin/bash -xe
-
-set -x -e
-
-echo "running as" $(id)
-
-. /home/worker/scripts/xvfb.sh
-
-####
-# Taskcluster friendly wrapper for performing fx desktop tests via mozharness.
-####
-
-# Inputs, with defaults
-
-: MOZHARNESS_URL                ${MOZHARNESS_URL}
-: MOZHARNESS_SCRIPT             ${MOZHARNESS_SCRIPT}
-: MOZHARNESS_CONFIG             ${MOZHARNESS_CONFIG}
-: NEED_XVFB                     ${NEED_XVFB:=true}
-: 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
-
-fail() {
-    echo # make sure error message is on a new line
-    echo "[test-linux.sh:error]" "${@}"
-    exit 1
-}
-
-# test required parameters are supplied
-if [[ -z ${MOZHARNESS_URL} ]]; then fail "MOZHARNESS_URL is not set"; fi
-if [[ -z ${MOZHARNESS_SCRIPT} ]]; then fail "MOZHARNESS_SCRIPT is not set"; fi
-if [[ -z ${MOZHARNESS_CONFIG} ]]; then fail "MOZHARNESS_CONFIG is not set"; fi
-
-mkdir -p ~/artifacts/public
-
-cleanup() {
-    local rv=$?
-    if [[ -s /home/worker/.xsession-errors ]]; then
-      # To share X issues
-      cp /home/worker/.xsession-errors ~/artifacts/public/xsession-errors.log
-    fi
-    cleanup_xvfb
-    exit $rv
-}
-trap cleanup EXIT INT
-
-# Unzip the mozharness ZIP file created by the build task
-if ! curl --fail -o mozharness.zip --retry 10 -L $MOZHARNESS_URL; then
-    fail "failed to download mozharness zip"
-fi
-rm -rf mozharness
-unzip -q mozharness.zip
-rm mozharness.zip
-
-if ! [ -d mozharness ]; then
-    fail "mozharness zip did not contain mozharness/"
-fi
-
-# start up the pulseaudio daemon.  Note that it's important this occur
-# before the Xvfb startup for ubuntu 12.04, not for 16.04
-if $NEED_PULSEAUDIO; then
-    pulseaudio --fail --daemonize --start
-    pactl load-module module-null-sink
-fi
-
-# run XVfb in the background, if necessary
-if $NEED_XVFB; then
-    start_xvfb '1600x1200x24' 0
-fi
-
-if $START_VNC; then
-    x11vnc > ~/artifacts/public/x11vnc.log 2>&1 &
-fi
-
-if $NEED_WINDOW_MANAGER; then
-    # This is read by xsession to select the window manager
-    echo DESKTOP_SESSION=ubuntu > /home/worker/.xsessionrc
-
-    # note that doing anything with this display before running Xsession will cause sadness (like,
-    # crashes in compiz). Make sure that X has enough time to start
-    sleep 15
-    # DISPLAY has already been set above
-    # XXX: it would be ideal to add a semaphore logic to make sure that the
-    # window manager is ready
-    /etc/X11/Xsession 2>&1 &
-
-    # Turn off the screen saver and screen locking
-    gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
-    gsettings set org.gnome.desktop.screensaver lock-enabled false
-    gsettings set org.gnome.desktop.screensaver lock-delay 3600
-    # Disable the screen saver
-    xset s off s reset
-fi
-
-# For telemetry purposes, the build process wants information about the
-# source it is running; tc-vcs obscures this a little, but we can provide
-# it directly.
-export MOZ_SOURCE_REPO="${GECKO_HEAD_REPOSITORY}"
-export MOZ_SOURCE_CHANGESET="${GECKO_HEAD_REV}"
-
-# support multiple, space delimited, config files
-config_cmds=""
-for cfg in $MOZHARNESS_CONFIG; do
-  config_cmds="${config_cmds} --config-file $WORKSPACE/${cfg}"
-done
-
-mozharness_bin="/home/worker/bin/run-mozharness"
-
-# Save the computed mozharness command to a binary which is useful
-# for interactive mode.
-echo -e "#!/usr/bin/env bash
-# Some mozharness scripts assume base_work_dir is in
-# the current working directory, see bug 1279237
-cd $WORKSPACE
-cmd=\"python2.7 $WORKSPACE/${MOZHARNESS_SCRIPT} ${config_cmds} ${@} \${@}\"
-echo \"Running: \${cmd}\"
-exec \${cmd}" > ${mozharness_bin}
-chmod +x ${mozharness_bin}
-
-# In interactive mode, the user will be prompted with options for what to do.
-if ! $TASKCLUSTER_INTERACTIVE; then
-  # run the given mozharness script and configs, but pass the rest of the
-  # arguments in from our own invocation
-  ${mozharness_bin};
-fi
--- a/testing/docker/desktop-test/Dockerfile
+++ b/testing/docker/desktop-test/Dockerfile
@@ -16,18 +16,18 @@ ADD topsrcdir/testing/docker/recipes/xvf
 
 # %include testing/docker/recipes/ubuntu1204-test-system-setup.sh
 ADD topsrcdir/testing/docker/recipes/ubuntu1204-test-system-setup.sh /setup/system-setup.sh
 RUN bash /setup/system-setup.sh
 
 # %include testing/docker/recipes/run-task
 ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task
 
-# %include taskcluster/scripts/tester/test-ubuntu1204.sh
-ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu1204.sh /home/worker/bin/test-linux.sh
+# %include taskcluster/scripts/tester/test-ubuntu.sh
+ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu.sh /home/worker/bin/test-linux.sh
 
 # This will create a host mounted filesystem when the cache is stripped
 # on Try. This cancels out some of the performance losses of aufs. See
 # bug 1291940.
 VOLUME /home/worker/hg-shared
 VOLUME /home/worker/checkouts
 VOLUME /home/worker/workspace
 
--- a/testing/docker/desktop1604-test/Dockerfile
+++ b/testing/docker/desktop1604-test/Dockerfile
@@ -16,18 +16,18 @@ RUN           bash /setup/system-setup.s
 
 # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb
 # %include testing/docker/recipes/xvfb.sh
 ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh
 
 # %include testing/docker/recipes/run-task
 ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task
 
-# %include taskcluster/scripts/tester/test-ubuntu1604.sh
-ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu1604.sh /home/worker/bin/test-linux.sh
+# %include taskcluster/scripts/tester/test-ubuntu.sh
+ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu.sh /home/worker/bin/test-linux.sh
 
 # This will create a host mounted filesystem when the cache is stripped
 # on Try. This cancels out some of the performance losses of aufs. See
 # bug 1291940.
 VOLUME /home/worker/hg-shared
 VOLUME /home/worker/checkouts
 VOLUME /home/worker/workspace