Bug 1250904 - Don't run mozharness if TASKCLUSTER_INTERACTIVE is set, r=armenzg
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 25 May 2016 11:10:52 -0400
changeset 300920 12b3b927435f
parent 300919 7b3ad5d93fbd
child 300921 fb0507f42e74
push id78137
push userahalberstadt@mozilla.com
push dateTue, 07 Jun 2016 19:05:23 +0000
treeherdermozilla-inbound@fb0507f42e74 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarmenzg
bugs1250904
milestone50.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 1250904 - Don't run mozharness if TASKCLUSTER_INTERACTIVE is set, r=armenzg Rather than guess what the developer means to do when they checkout an interactive tester, we'll prompt them from the interactive shell. This means we need to bypass the mozharness script initially. To make it easy to run again later, we save the exact command to a 'run-mozharness' binary. MozReview-Commit-ID: DzBlVUs9R8I
testing/taskcluster/scripts/tester/test-linux.sh
--- a/testing/taskcluster/scripts/tester/test-linux.sh
+++ b/testing/taskcluster/scripts/tester/test-linux.sh
@@ -12,17 +12,16 @@ echo "running as" $(id)
 
 : 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}
-: SKIP_MOZHARNESS_RUN           ${SKIP_MOZHARNESS_RUN:=false}
 : WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
 : mozharness args               "${@}"
 
 set -v
 cd $WORKSPACE
 
 fail() {
     echo # make sure error message is on a new line
@@ -39,17 +38,17 @@ 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
     # When you call this script with START_VNC we make sure we
-    # don't kill xvfb so you don't loose your VNC connection
+    # don't kill xvfb so you don't lose your VNC connection
     if [ -n "$xvfb_pid" ] && [ $START_VNC == false ] ; then
         kill $xvfb_pid || true
     fi
     exit $rv
 }
 trap cleanup EXIT INT
 
 # Unzip the mozharness ZIP file created by the build task
@@ -125,23 +124,27 @@ fi
 # 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 ${cfg}"
+  config_cmds="${config_cmds} --config-file $WORKSPACE/${cfg}"
 done
 
-if [ ${SKIP_MOZHARNESS_RUN} == true ]; then
-  # Skipping Mozharness is to allow the developer start the window manager
-  # properly and letting them change the execution of Mozharness without
-  # exiting the container
-  echo "We skipped running Mozharness."
-  echo "Make sure you export DISPLAY=:0 before calling Mozharness."
-  echo "Don't forget to call it with 'sudo -E -u worker'."
-else
+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
+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" != "true" ]; then
   # run the given mozharness script and configs, but pass the rest of the
   # arguments in from our own invocation
-  python2.7 $WORKSPACE/${MOZHARNESS_SCRIPT} ${config_cmds} "${@}"
+  ${mozharness_bin};
 fi