From 6d14e6268512d241354efe954e60c5b2b659caa2 Mon Sep 17 00:00:00 2001 From: ky_liyl Date: Wed, 4 Dec 2024 15:17:59 +0800 Subject: [PATCH] Handle stream running issues --- src/kytuning/main.py | 12 ++++++------ src/kytuning/test.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/kytuning/main.py b/src/kytuning/main.py index 7579126..3a14aa1 100644 --- a/src/kytuning/main.py +++ b/src/kytuning/main.py @@ -22,7 +22,7 @@ class Main(object): def __parse_argv(self): if len(sys.argv) < 2: - print('input scheme path.') + logging.error('input scheme path.') sys.exit() opts, args = getopt.getopt(sys.argv[1:], "hf:", ["help", "report_path="]) @@ -34,15 +34,15 @@ class Main(object): pass if len(args) == 0: - print('input scheme path.') + logging.error('input scheme path.') sys.exit() for file in args: if file is None or len(file) == 0: - print('invalid scheme path : "%s"' % file) + logging.error('invalid scheme path : "%s"' % file) sys.exit() if not os.path.exists(file): - print("scheme not found: \"%s\"" % file) + logging.error("scheme not found: \"%s\"" % file) sys.exit() return args @@ -59,9 +59,9 @@ class Main(object): test.do_test() # 环境、安装软件、设置配置文件、运行测试 test.export(self.config.report_path) # 测试结果保存接口 except SchemeError as e: - print(e) + logging.error(e) except SchemeParserError as e: - print(e) + logging.error(e) except TestNotFound as e: logging.error(e) except TestCaseError as e: diff --git a/src/kytuning/test.py b/src/kytuning/test.py index 6366037..9073630 100644 --- a/src/kytuning/test.py +++ b/src/kytuning/test.py @@ -223,7 +223,7 @@ class StreamTest(BaseTest): for item in os.listdir(tdir): path = '{tdir}/{item}'.format(tdir=tdir, item=item) stat = os.stat('{tdir}/{item}'.format(tdir=tdir, item=item)) - if item.startswith('Single') or item.startswith('1-'): + if item.startswith('Single') : s_save = self.compare_and_return_newer(s_save, (path, stat)) else: m_save = self.compare_and_return_newer(s_save, (path, stat)) -- Gitee