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

--HG--
extra : rebase_source : 264efc9b30e62927dece848b9b1eab7542cf2cba
extra : source : 8335aa40265b1d17421d06d9e9a180eb8419fe47
extra : histedit_source : a5ae54a810718d446ded8bab510e6cd605562737
This commit is contained in:
Gregory Szorc 2016-08-09 14:34:58 -07:00
Родитель 755f4ce8db
Коммит d8a853a72c
6 изменённых файлов: 11 добавлений и 44 удалений

Просмотреть файл

@ -22,7 +22,9 @@ echo "running as" $(id)
: mozharness args "${@}"
set -v
cd $WORKSPACE
mkdir -p ${WORKSPACE}
cd ${WORKSPACE}
fail() {
echo # make sure error message is on a new line

Просмотреть файл

@ -22,7 +22,9 @@ echo "running as" $(id)
: mozharness args "${@}"
set -v
cd $WORKSPACE
mkdir -p ${WORKSPACE}
cd ${WORKSPACE}
fail() {
echo # make sure error message is on a new line

Просмотреть файл

@ -192,8 +192,12 @@ def docker_worker_setup(config, test, taskdesc):
])
# 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([

Просмотреть файл

@ -38,7 +38,6 @@ 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

Просмотреть файл

@ -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 "${@}"

Просмотреть файл

@ -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 "${@}"