diff options
author | Andrea Frittoli (andreaf) <andrea.frittoli@hp.com> | 2015-06-26 16:29:29 +0100 |
---|---|---|
committer | Andrea Frittoli (andreaf) <andrea.frittoli@hp.com> | 2015-07-08 21:29:11 +0100 |
commit | d30fe3b8b91fdaec90e9d4d490e021c71992e332 (patch) | |
tree | 984c6250bc65d74a62be55b7144e2b21fccb8a77 /tempest/test_discover | |
parent | 91ebdfac2f6021aa1bccceaf4274bb801cc0891b (diff) | |
download | tempest-d30fe3b8b91fdaec90e9d4d490e021c71992e332.tar.gz |
Provide a full path top level to test discovery
OS_TOP_LEVEL environment variable allows for the tempest code
to be in a different tree compared to .testr.conf.
However test_discover does not work because relative path is
passed in as top level. Fixing that.
Change-Id: Ieee0704c4895381bc64234bb18e720df67187aad
Diffstat (limited to 'tempest/test_discover')
-rw-r--r-- | tempest/test_discover/test_discover.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tempest/test_discover/test_discover.py b/tempest/test_discover/test_discover.py index a871d10dc..86aa85562 100644 --- a/tempest/test_discover/test_discover.py +++ b/tempest/test_discover/test_discover.py @@ -30,12 +30,14 @@ def load_tests(loader, tests, pattern): base_path = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0] base_path = os.path.split(base_path)[0] # Load local tempest tests - for test_dir in ['./tempest/api', './tempest/scenario', - './tempest/thirdparty']: + for test_dir in ['tempest/api', 'tempest/scenario', + 'tempest/thirdparty']: + full_test_dir = os.path.join(base_path, test_dir) if not pattern: - suite.addTests(loader.discover(test_dir, top_level_dir=base_path)) + suite.addTests(loader.discover(full_test_dir, + top_level_dir=base_path)) else: - suite.addTests(loader.discover(test_dir, pattern=pattern, + suite.addTests(loader.discover(full_test_dir, pattern=pattern, top_level_dir=base_path)) plugin_load_tests = ext_plugins.get_plugin_load_tests_tuple() |