jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/388084 )

Change subject: Support args for tox container
......................................................................


Support args for tox container

pywikibot/core tests takes a while. They have been split in three
differents bits corresponding tox testenvs: nose, nose34 and doc.

docker-run-with-log-and-workspace-cache macro is solely used by the tox
jobs. Make it pass to docker run the jjb variable {run_args} defaulting
to an empty string if it is not set.

Create a new template '{name}-tox-{toxenv}-docker' and pass to the macro
the tox options to select the testenv we want. I had to duplicate the
builders section unfortunately.

Update wmfreleng/tox

ENTRYPOINT changed to exec form so that the command is no more wrapped
in a sh -c '' which shallow signals and does not pass arguments.
Update run.sh to accept arguments.

Create:
    pywikibot-core-tox-nose-docker
    pywikibot-core-tox-nose34-docker
    pywikibot-core-tox-doc-docker

Change-Id: I14f60225382a8b0524c1fffe1d6ec9ae3525aaa9
---
M dockerfiles/tox/run.sh
M jjb/macro-docker.yaml
M jjb/python-jobs.yaml
M jjb/pywikibot.yaml
M zuul/layout.yaml
5 files changed, 32 insertions(+), 3 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/dockerfiles/tox/run.sh b/dockerfiles/tox/run.sh
index 2abd52b..d049627 100755
--- a/dockerfiles/tox/run.sh
+++ b/dockerfiles/tox/run.sh
@@ -25,4 +25,4 @@
 
 # Run tests. Pass all environment variables to tox since the environment here
 # is already pretty restrictive.
-TOX_TESTENV_PASSENV="*" PY_COLORS=1 tox -v
+TOX_TESTENV_PASSENV="*" PY_COLORS=1 tox -v "${@}"
diff --git a/jjb/macro-docker.yaml b/jjb/macro-docker.yaml
index 080fdb1..d5bcf1f 100644
--- a/jjb/macro-docker.yaml
+++ b/jjb/macro-docker.yaml
@@ -74,6 +74,12 @@
         # nothing else can be executed due to exec
 
 # Run a docker image with .env and a log and cache directory
+#
+# Parameters:
+#
+# image: the Docker image to run (eg: wmfreleng/php)
+# run_args (optional): arguments passed to `docker run`.
+#                      XXX must start with a leading space
 - builder:
     name: docker-run-with-log-and-workspace-cache
     builders:
@@ -85,7 +91,7 @@
             --env-file .env \
             --volume "$(pwd)"/log:{logdir} \
             --volume "$(pwd)"/cache:/cache \
-            {image}
+            {image}{obj:run_args|}
         # nothing else can be executed due to exec
 
 # Run a docker image with cache, log, and src directories
diff --git a/jjb/python-jobs.yaml b/jjb/python-jobs.yaml
index c7d95c5..7c97652 100644
--- a/jjb/python-jobs.yaml
+++ b/jjb/python-jobs.yaml
@@ -68,7 +68,7 @@
     name: 'tox-docker'
     node: DebianJessieDocker
     concurrent: true
-    docker_image_var: 'wmfreleng/tox:v2017.11.10.11.49'
+    docker_image_var: 'wmfreleng/tox:v2017.11.10.16.17'
     triggers:
         - zuul
     builders:
@@ -93,6 +93,20 @@
     triggers:
         - zuul
 
+- job-template:
+    !!merge : *job_tox-docker
+    name: '{name}-tox-{toxenv}-docker'
+    triggers:
+        - zuul
+    builders:
+        - docker-castor-load
+        - docker-zuul-env
+        - docker-log-dir
+        - docker-run-with-log-and-workspace-cache:
+            image: 'wmfreleng/tox:v2017.11.10.16.17'
+            logdir: '/log'
+            run_args: ' -e "{toxenv}"'
+
 # Call tox env 'docvenv' (default: 'doc' to generate documentation in labs and
 # publish to doc.wikimedia.org using an intermediate rsync repository in labs.
 # Intended for changes being merged, eg in 'postmerge'
diff --git a/jjb/pywikibot.yaml b/jjb/pywikibot.yaml
index 7943688..7ac4db2 100644
--- a/jjb/pywikibot.yaml
+++ b/jjb/pywikibot.yaml
@@ -11,6 +11,11 @@
           - doc
           - nose
           - nose34
+     - '{name}-tox-{toxenv}-docker':
+         toxenv:
+             - doc
+             - nose
+             - nose34
 
 - project:
     name: pywikibot-i18n
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 00ea5e7..0b077b5 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -7342,6 +7342,10 @@
       - pywikibot-core-tox-doc-jessie
     postmerge:
       - pywikibot-core-tox-publish
+    experimental:
+      - pywikibot-core-tox-nose-docker
+      - pywikibot-core-tox-nose34-docker
+      - pywikibot-core-tox-doc-docker
 
   - name: pywikibot/i18n
     test:

-- 
To view, visit https://gerrit.wikimedia.org/r/388084
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I14f60225382a8b0524c1fffe1d6ec9ae3525aaa9
Gerrit-PatchSet: 5
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: Thcipriani <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to