--regex and --blacklist_file does not work together
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
os-testr |
Fix Released
|
Undecided
|
Attila Fazekas | ||
tempest |
Invalid
|
Undecided
|
Szymon Datko |
Bug Description
1. when specifying both --regex <regex> and --blacklist_file when calling ostestr the regex applied is not correct
--- shell ---
$ cat tempest_
tempest.api
$ ostestr --blacklist_file tempest_
running=
OS_STDERR_
OS_TEST_
OS_TEST_
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_
--- /shell ---
the exclude_regex variable inside os_testr.py seem to be
^((?!tempest.
which doesn't match any of the existing tests under /opt/stack/tempest due to new line character ($)
2. running the below gives same no results:
testr list_tests '^((?!tempest.
3. removing new line character (which is added by os_testr.py unconditionally):
testr list_tests '^((?!tempest.
running=
OS_STDERR_
OS_TEST_
OS_TEST_
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_
tempest.
Changed in os-testr: | |
assignee: | nobody → Waldemar Znoinski (wznoinsk) |
Changed in os-testr: | |
status: | Confirmed → In Progress |
Changed in tempest: | |
assignee: | nobody → Szymon Datko (sdatko) |
status: | New → In Progress |
4) another example [.*\bslow\ b.*\])( ^tempest\ .(api|scenario| thirdparty) )' --list OS_STDOUT_ CAPTURE= ${OS_STDOUT_ CAPTURE: -1} \ CAPTURE= ${OS_STDERR_ CAPTURE: -1} \ TIMEOUT= ${OS_TEST_ TIMEOUT: -500} \ LOCK_PATH= ${OS_TEST_ LOCK_PATH: -${TMPDIR: -'/tmp' }} \ PATH:-. /tempest/ test_discover} --list api.baremetal. admin.test_ api_discovery. TestApiDiscover y.test_ api_versions[ id-a3c27e94- f56c-42c4- 8600-d6790650b9 c5] api.baremetal. admin.test_ api_discovery. TestApiDiscover y.test_ default_ version[ id-896283a6- 488e-4f31- af78-6614286cbe 0d] api.baremetal. admin.test_ api_discovery. TestApiDiscover y.test_ version_ 1_resources[ id-abc0b34d- e684-4546- 9728-ab7a9ad9f1 74]
4a) $ ostestr --regex '(?!.*\
running=
OS_STDERR_
OS_TEST_
OS_TEST_
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_
tempest.
tempest.
tempest.
...
4b) same with blacklist_file
$ cat bl
.*\[.*\bslow\b.*\]
4c) ostestr --blacklist_file bl --regex '(^tempest\ .(api|scenario| thirdparty) )' --list OS_STDOUT_ CAPTURE= ${OS_STDOUT_ CAPTURE: -1} \ CAPTURE= ${OS_STDERR_ CAPTURE: -1} \ TIMEOUT= ${OS_TEST_ TIMEOUT: -500} \ LOCK_PATH= ${OS_TEST_ LOCK_PATH: -${TMPDIR: -'/tmp' }} \ PATH:-. /tempest/ test_discover} --list
running=
OS_STDERR_
OS_TEST_
OS_TEST_
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_
4d) regex formed from blacklist_file + --regex looks to be: \[.*\bslow\ b.*\]). )*$(^tempest\ .(api|scenario| thirdparty) ) .*\bslow\ b.*\])( ^tempest\ .(api|scenario| thirdparty) ) (pasted here from 4a) for comparison)
^((?!.*
(?!.*\[