summaryrefslogtreecommitdiffstats
path: root/dovetail/testcase.py
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2016-12-15 02:09:35 +0000
committerxudan <xudan16@huawei.com>2016-12-15 10:17:14 +0000
commit3298811ce85e54c3c766ca7cf1e77bfd66956ab5 (patch)
treea0e4dba748f0333e41451e68580bc90e29fb6a3a /dovetail/testcase.py
parent2ae61333cb9dae3bc8d5da567323b05ebe2f1108 (diff)
dovetail tool: bugfix about setup dovetail
1. change the entry_points of setup.cfg into dovetail.run:main 2. after setup the command 'dovetail -d true --testsuite debug' can just be successfully executed under folder dovetail/dovetail. That is mainly because of the load functions of testcase.py using relative paths. 3. using absolute path instead of relative path can support the command successfully executed under any path. JIRA: DOVETAIL-154 Change-Id: I4a2ad39a1a60e7e63efc55515781d27b823aa894 Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail/testcase.py')
-rw-r--r--dovetail/testcase.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/dovetail/testcase.py b/dovetail/testcase.py
index 4310f9b4..dd0fd2b5 100644
--- a/dovetail/testcase.py
+++ b/dovetail/testcase.py
@@ -158,8 +158,10 @@ class Testcase(object):
@classmethod
def load(cls):
- for root, dirs, files in \
- os.walk(dt_cfg.dovetail_config['TESTCASE_PATH']):
+ testcase_dir = os.path.dirname(os.path.abspath(__file__))
+ testcase_path = dt_cfg.dovetail_config['TESTCASE_PATH']
+ abs_testcase_path = os.path.join(testcase_dir, testcase_path)
+ for root, dirs, files in os.walk(abs_testcase_path):
for testcase_file in files:
with open(os.path.join(root, testcase_file)) as f:
testcase_yaml = yaml.safe_load(f)
@@ -254,8 +256,10 @@ class Testsuite:
@classmethod
def load(cls):
- for root, dirs, files in \
- os.walk(dt_cfg.dovetail_config['COMPLIANCE_PATH']):
+ compliance_dir = os.path.dirname(os.path.abspath(__file__))
+ compliance_path = dt_cfg.dovetail_config['COMPLIANCE_PATH']
+ abs_compliance_path = os.path.join(compliance_dir, compliance_path)
+ for root, dirs, files in os.walk(abs_compliance_path):
for testsuite_yaml in files:
with open(os.path.join(root, testsuite_yaml)) as f:
testsuite_yaml = yaml.safe_load(f)