From 2979bff949e470ae83338ac9aead4d7456130c8a Mon Sep 17 00:00:00 2001 From: Sergey Vilgelm Date: Tue, 6 Nov 2018 10:34:03 -0600 Subject: [PATCH] Pass tox_extra_args to Run tempest task Patrole needs access to global packages, but the 'all-plugin' is deprecated[0] and 'all' defines a sitepackages option as False[1]. Adding tox_extra_args option makes it possible to configure Zuul and pass --sitepackages argument to tox. [0] https://github.com/openstack/tempest/blob/9b4c50cf634cbea6e6a7353fff14c2f0a7ab1aa2/tox.ini#L64 [1] https://github.com/openstack/tempest/blob/9b4c50cf634cbea6e6a7353fff14c2f0a7ab1aa2/tox.ini#L7 Change-Id: Ib3264f54075216471720483c8dd816887c1f413c --- roles/run-tempest/README.rst | 11 +++++++++++ roles/run-tempest/defaults/main.yaml | 1 + roles/run-tempest/tasks/main.yaml | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/roles/run-tempest/README.rst b/roles/run-tempest/README.rst index 71b8e4fdc3..e1787b64c9 100644 --- a/roles/run-tempest/README.rst +++ b/roles/run-tempest/README.rst @@ -56,3 +56,14 @@ Run Tempest (?x) # Ignore comments and whitespaces # Line with only a comment. (tempest.api.identity).*$ + +.. zuul:rolevar:: tox_extra_args + :default: '' + + String of extra command line options to pass to tox. + + Here is an example of running tox with --sitepackages option: + + :: + vars: + tox_extra_args: --sitepackages diff --git a/roles/run-tempest/defaults/main.yaml b/roles/run-tempest/defaults/main.yaml index c89eb937cd..06918b5ad8 100644 --- a/roles/run-tempest/defaults/main.yaml +++ b/roles/run-tempest/defaults/main.yaml @@ -2,3 +2,4 @@ devstack_base_dir: /opt/stack tempest_test_regex: '' tox_envlist: smoke tempest_black_regex: '' +tox_extra_args: '' diff --git a/roles/run-tempest/tasks/main.yaml b/roles/run-tempest/tasks/main.yaml index 54ddc71772..16086aa8c7 100644 --- a/roles/run-tempest/tasks/main.yaml +++ b/roles/run-tempest/tasks/main.yaml @@ -35,7 +35,7 @@ when: blacklist_stat.stat.exists - name: Run Tempest - command: tox -e {{tox_envlist}} -- {{tempest_test_regex|quote}} {{blacklist_option|default('')}} \ + command: tox -e {{tox_envlist}} {{tox_extra_args}} -- {{tempest_test_regex|quote}} {{blacklist_option|default('')}} \ --concurrency={{tempest_concurrency|default(default_concurrency)}} \ --black-regex={{tempest_black_regex|quote}} args: