From 6d8d1a4408966e4449df7c6f473d17c6efbadba4 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 21 Dec 2017 11:54:54 -0600 Subject: [PATCH] Move revoke-sudo from unittest pre to job run Having revoke-sudo in the pre playbook of unittest has made us not able to re-use unittest for javascript, and also means we can't use nodejs-npm for nodejs-npm-run-test, which is a bit odd. Instead, add the role to the run playbook for tox and npm, which allows us to stack and combine things a bit better. Change-Id: I0c7c508996ad2647db706d4ebf156c5dd96bf9b5 --- playbooks/javascript/pre-test.yaml | 10 ---------- playbooks/javascript/pre.yaml | 5 ----- playbooks/javascript/run.yaml | 1 + playbooks/tox/run.yaml | 1 + playbooks/unittests/pre.yaml | 1 - zuul.yaml | 4 ++-- 6 files changed, 4 insertions(+), 18 deletions(-) diff --git a/playbooks/javascript/pre-test.yaml b/playbooks/javascript/pre-test.yaml index 7956fc181..b82a1809f 100644 --- a/playbooks/javascript/pre-test.yaml +++ b/playbooks/javascript/pre-test.yaml @@ -1,13 +1,3 @@ - hosts: all roles: - - role: bindep - bindep_profile: test - bindep_dir: "{{ zuul_work_dir }}" - - test-setup - - install-nodejs - - install-yarn - # nodejs-test-dependencies requires sudo, - # so we cannot inherit pre.yaml from javascript-base. - nodejs-test-dependencies - - revoke-sudo - - install-javascript-packages diff --git a/playbooks/javascript/pre.yaml b/playbooks/javascript/pre.yaml index 4f6a0547a..34206c20c 100644 --- a/playbooks/javascript/pre.yaml +++ b/playbooks/javascript/pre.yaml @@ -1,10 +1,5 @@ - hosts: all roles: - - role: bindep - bindep_profile: test - bindep_dir: "{{ zuul_work_dir }}" - - test-setup - install-nodejs - install-yarn - - revoke-sudo - install-javascript-packages diff --git a/playbooks/javascript/run.yaml b/playbooks/javascript/run.yaml index 008c062e7..c712dd0e5 100644 --- a/playbooks/javascript/run.yaml +++ b/playbooks/javascript/run.yaml @@ -1,3 +1,4 @@ - hosts: all roles: + - revoke-sudo - npm diff --git a/playbooks/tox/run.yaml b/playbooks/tox/run.yaml index 22f82096c..65fd952d8 100644 --- a/playbooks/tox/run.yaml +++ b/playbooks/tox/run.yaml @@ -1,3 +1,4 @@ - hosts: all roles: + - revoke-sudo - tox diff --git a/playbooks/unittests/pre.yaml b/playbooks/unittests/pre.yaml index 55e702ec0..379ce8cf0 100644 --- a/playbooks/unittests/pre.yaml +++ b/playbooks/unittests/pre.yaml @@ -3,4 +3,3 @@ - role: bindep bindep_dir: "{{ zuul_work_dir }}" - test-setup - - revoke-sudo diff --git a/zuul.yaml b/zuul.yaml index 06816fbbc..928b82aff 100644 --- a/zuul.yaml +++ b/zuul.yaml @@ -237,6 +237,7 @@ - job: name: nodejs-npm + parent: unittests description: | Base job for javascript operations @@ -323,6 +324,7 @@ - job: name: nodejs-npm-run-test + parent: nodejs-npm description: | Run test using nodejs. This test also starts Xvfb for run time tests. @@ -344,8 +346,6 @@ Directory, relative to zuul_work_dir, holding build content. pre-run: playbooks/javascript/pre-test.yaml - run: playbooks/javascript/run.yaml - post-run: playbooks/javascript/post.yaml vars: npm_command: test