summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Hoge <chris@openstack.org>2015-02-26 14:12:15 -0800
committerChris Hoge <chris@openstack.org>2015-02-26 16:05:16 -0800
commit7579c1a40e68e58af2403181c67e2e687e8cf074 (patch)
treebcedef09f6ea972d06c8f1f8568f445cf6922917 /tools
parent296558cf413f021b316afd588ba823bc94a88e95 (diff)
downloadtempest-7579c1a40e68e58af2403181c67e2e687e8cf074.tar.gz
Add UUIDs to all tempest tests and gate check
Adds uuid4 as a decorator of the form: @test.idempotent_id('12345678-1234-1234-1234-123456789abc') to every test in the Tempest tree. Includes a gate check to ensure the existence and uniqueness of the ids. Modify check tool to ignore Tempest unit tests. Change-Id: I19e3c7dd555a3ea09d585fb9091c357a300e6559 Co-Authored-By: Sergey Slipushenko <sslypushenko@mirantis.com> Implements: bp test-uuid
Diffstat (limited to 'tools')
-rw-r--r--tools/check_uuid.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/check_uuid.py b/tools/check_uuid.py
index 837da4800..541e6c30c 100644
--- a/tools/check_uuid.py
+++ b/tools/check_uuid.py
@@ -28,6 +28,7 @@ DECORATOR_IMPORT = 'tempest.%s' % DECORATOR_MODULE
IMPORT_LINE = 'from tempest import %s' % DECORATOR_MODULE
DECORATOR_TEMPLATE = "@%s.%s('%%s')" % (DECORATOR_MODULE,
DECORATOR_NAME)
+UNIT_TESTS_EXCLUDE = 'tempest.tests'
class SourcePatcher(object):
@@ -103,8 +104,10 @@ class TestChecker(object):
root_package = self._path_to_package(root)
for item in files:
if item.endswith('.py'):
- modules.append('.'.join((root_package,
- os.path.splitext(item)[0])))
+ module_name = '.'.join((root_package,
+ os.path.splitext(item)[0]))
+ if not module_name.startswith(UNIT_TESTS_EXCLUDE):
+ modules.append(module_name)
return modules
@staticmethod
@@ -343,7 +346,9 @@ def run():
else:
errors = checker.report_untagged(untagged) or errors
if errors:
- sys.exit('@test.idempotent_id existence and uniqueness checks failed')
+ sys.exit("@test.idempotent_id existence and uniqueness checks failed\n"
+ "Run 'tox -v -euuidgen' to automatically fix tests with\n"
+ "missing @test.idempotent_id decorators.")
if __name__ == '__main__':
run()