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
(cherry picked from commit 83214319b1)
(cherry picked from commit eea1168327)
This commit is contained in:
yatinkarel 2021-01-25 16:58:54 +05:30 committed by yatin
parent f8016293a3
commit 1c1b49f979
4 changed files with 24 additions and 1 deletions

View File

@ -1035,6 +1035,9 @@ Provisioning tempest config
**CONFIG_RUN_TEMPEST_TESTS** **CONFIG_RUN_TEMPEST_TESTS**
Test suites to run, example: "smoke dashboard TelemetryAlarming". Optional, defaults to "smoke". 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** **CONFIG_PROVISION_UEC_IMAGE_NAME**
Name of the uec image created in Glance used in tempest tests (default "cirros-uec"). Name of the uec image created in Glance used in tempest tests (default "cirros-uec").

View File

@ -56,8 +56,9 @@ def run_tempest(config, messages):
print("Running Tempest on %s" % config['CONFIG_TEMPEST_HOST']) print("Running Tempest on %s" % config['CONFIG_TEMPEST_HOST'])
server = utils.ScriptRunner(config['CONFIG_TEMPEST_HOST']) server = utils.ScriptRunner(config['CONFIG_TEMPEST_HOST'])
server.append('pushd /var/lib/tempest') 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_RUN_TEMPEST_TESTS'].replace(' ', '|'),
config['CONFIG_SKIP_TEMPEST_TESTS'].replace(' ', '|'),
logfile)) logfile))
server.append('popd') server.append('popd')
server.execute() server.execute()

View File

@ -406,6 +406,19 @@ def initConfig(controller):
"CONF_NAME": "CONFIG_RUN_TEMPEST_TESTS", "CONF_NAME": "CONFIG_RUN_TEMPEST_TESTS",
"USE_DEFAULT": False, "USE_DEFAULT": False,
"NEED_CONFIRM": 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} "CONDITION": False}
], ],

View File

@ -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".