diff options
author | xudan <xudan16@huawei.com> | 2019-07-10 21:59:21 -0400 |
---|---|---|
committer | Dan Xu <xudan16@huawei.com> | 2019-08-23 09:28:42 +0000 |
commit | 14a9a43bf675469486a6991976bef24f3540217b (patch) | |
tree | a1acbba077ae0e6100970153a4951c96f3eaf027 /dovetail/run.py | |
parent | a85d35f86170a2a2f2455fa157c12be823060522 (diff) |
Add run tests API
Change-Id: I456d5d1459faa20d9dd8afd0c235a4bb6cbfbcce
Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail/run.py')
-rwxr-xr-x | dovetail/run.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dovetail/run.py b/dovetail/run.py index c83c1973..0ea3cb11 100755 --- a/dovetail/run.py +++ b/dovetail/run.py @@ -12,6 +12,7 @@ import copy from datetime import datetime +import json import os import time import uuid @@ -275,6 +276,13 @@ def main(*args, **kwargs): dt_utils.check_docker_version(logger) testcase_list = get_testcase_list(logger, **kwargs) + + dovetail_home = os.environ['DOVETAIL_HOME'] + testcases_file = os.path.join(dovetail_home, 'results', 'testcases.json') + with open(testcases_file, "w") as f: + data = {'testsuite': kwargs['testsuite'], 'testcases': testcase_list} + f.write(json.dumps(data) + '\n') + if not testcase_list: raise SystemExit(EXIT_RUN_FAILED) |