Hashar has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/389924 )
Change subject: docker: enhance tox image for signals
......................................................................
docker: enhance tox image for signals
Change Docker ENTRYPOINT to exec form, else our script is wrapped in a
sh -c '', which shallows signals.
Make run.sh executable.
Drop a misleading comment about setting envlogdir in tox.
Rename the trap function and register it after the git commands. In case
git fails, that will no more attempts to capture inexistents tox log
files.
Stop logging to stdout. It is already in the Jenkins console.
Change-Id: Ia1f481f1f7fb1d41dee671e7fad429a694e60dfd
---
M dockerfiles/tox/Dockerfile
M dockerfiles/tox/run.sh
2 files changed, 5 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/integration/config
refs/changes/24/389924/1
diff --git a/dockerfiles/tox/Dockerfile b/dockerfiles/tox/Dockerfile
index af45d37..71c8993 100644
--- a/dockerfiles/tox/Dockerfile
+++ b/dockerfiles/tox/Dockerfile
@@ -26,5 +26,5 @@
USER nobody
WORKDIR /src
-ENTRYPOINT /bin/bash /run.sh
+ENTRYPOINT ["/run.sh"]
COPY run.sh /run.sh
diff --git a/dockerfiles/tox/run.sh b/dockerfiles/tox/run.sh
old mode 100644
new mode 100755
index 73df486..2abd52b
--- a/dockerfiles/tox/run.sh
+++ b/dockerfiles/tox/run.sh
@@ -7,17 +7,12 @@
LOG_DIR=/log
export LOG_DIR
-capture_logs() {
+capture_tox_logs() {
# XXX unlike `mv`, `cp` does not preserve permissions and hence the
# destination files will inherit the group thanks to log having setgid.
- #
- # XXX later tox version supports specifying the envs log directory
- #
cp --recursive /src/.tox/*/log/*.log "${LOG_DIR}" || /bin/true
cp --recursive /src/.tox/log "${LOG_DIR}" || /bin/true
}
-
-trap capture_logs EXIT
cd /src
@@ -26,6 +21,8 @@
git checkout --quiet FETCH_HEAD
git submodule --quiet update --init --recursive
+trap capture_tox_logs EXIT
+
# Run tests. Pass all environment variables to tox since the environment here
# is already pretty restrictive.
-TOX_TESTENV_PASSENV="*" PY_COLORS=1 tox -v | tee "${LOG_DIR}/stdout.log"
+TOX_TESTENV_PASSENV="*" PY_COLORS=1 tox -v
--
To view, visit https://gerrit.wikimedia.org/r/389924
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1f481f1f7fb1d41dee671e7fad429a694e60dfd
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits