From 83214319b19bb0d95f17b5a64583d1674c69d2b1 Mon Sep 17 00:00:00 2001 From: yatinkarel Date: Mon, 25 Jan 2021 16:58:54 +0530 Subject: [PATCH] Add config option to skip tempest tests Add new option "CONFIG_SKIP_TEMPEST_TESTS" to allow skipping some of tempest tests which are defined with "CONFIG_RUN_TEMPEST_TESTS". So for scenario to run all smoke and dashboard tests except "test_volume_create" tests following can be configured:- CONFIG_RUN_TEMPEST_TESTS: "smoke dashboard" CONFIG_SKIP_TEMPEST_TESTS: "test_volume_create" Change-Id: Idab8dae17437f0940f872195f53fc934893aa283 --- docs/packstack.rst | 3 +++ packstack/plugins/postscript_951.py | 3 ++- packstack/plugins/provision_700.py | 13 +++++++++++++ ...-skip-tempest-tests-option-86cf59ec5a61d349.yaml | 6 ++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/add-skip-tempest-tests-option-86cf59ec5a61d349.yaml diff --git a/docs/packstack.rst b/docs/packstack.rst index 0ad927176..d34e1b8b5 100755 --- a/docs/packstack.rst +++ b/docs/packstack.rst @@ -1023,6 +1023,9 @@ Provisioning tempest config **CONFIG_RUN_TEMPEST_TESTS** Test suites to run, example: "smoke dashboard TelemetryAlarming". Optional, defaults to "smoke". +**CONFIG_SKIP_TEMPEST_TESTS** + Tests to skip, example: "test_basic_scenario test_volume". Optional, defaults to "". + **CONFIG_PROVISION_UEC_IMAGE_NAME** Name of the uec image created in Glance used in tempest tests (default "cirros-uec"). diff --git a/packstack/plugins/postscript_951.py b/packstack/plugins/postscript_951.py index fd4da8877..a6e02f21e 100644 --- a/packstack/plugins/postscript_951.py +++ b/packstack/plugins/postscript_951.py @@ -56,8 +56,9 @@ def run_tempest(config, messages): print("Running Tempest on %s" % config['CONFIG_TEMPEST_HOST']) server = utils.ScriptRunner(config['CONFIG_TEMPEST_HOST']) server.append('pushd /var/lib/tempest') - server.append('tempest run --regex \'(%s)\' --concurrency 2 > %s' + server.append('tempest run --regex \'(%s)\' --black-regex \'%s\' --concurrency 2 > %s' % (config['CONFIG_RUN_TEMPEST_TESTS'].replace(' ', '|'), + config['CONFIG_SKIP_TEMPEST_TESTS'].replace(' ', '|'), logfile)) server.append('popd') server.execute() diff --git a/packstack/plugins/provision_700.py b/packstack/plugins/provision_700.py index e051d2550..358e13a5e 100644 --- a/packstack/plugins/provision_700.py +++ b/packstack/plugins/provision_700.py @@ -342,6 +342,19 @@ def initConfig(controller): "CONF_NAME": "CONFIG_RUN_TEMPEST_TESTS", "USE_DEFAULT": False, "NEED_CONFIRM": False, + "CONDITION": False}, + + {"CMD_OPTION": "skip-tempest-tests", + "PROMPT": ("What tempest tests should skipped ?" + " (If blank, Tempest will not skip any tests)"), + "OPTION_LIST": [], + "VALIDATORS": False, + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": True, + "CONF_NAME": "CONFIG_SKIP_TEMPEST_TESTS", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, "CONDITION": False} ], diff --git a/releasenotes/notes/add-skip-tempest-tests-option-86cf59ec5a61d349.yaml b/releasenotes/notes/add-skip-tempest-tests-option-86cf59ec5a61d349.yaml new file mode 100644 index 000000000..0bf75aaaa --- /dev/null +++ b/releasenotes/notes/add-skip-tempest-tests-option-86cf59ec5a61d349.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add new config option "CONFIG_SKIP_TEMPEST_TESTS" to allow + skipping of some of tempest tests which are running as part + of "CONFIG_RUN_TEMPEST_TESTS".