From ed1e3c304a627a3da0257691dda8ee7c18cc4808 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Fri, 2 Aug 2024 14:03:07 +0800 Subject: [PATCH] test: scan returned values in ci --- tests/ci/scan_file_path.py | 18 +++++++++--------- tests/script/tsim/mnode/basic3.sim | 6 +++--- tests/system-test/2-query/tsma.py | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/ci/scan_file_path.py b/tests/ci/scan_file_path.py index 0e47387f67..f4cf25b8f7 100644 --- a/tests/ci/scan_file_path.py +++ b/tests/ci/scan_file_path.py @@ -179,11 +179,11 @@ if __name__ == "__main__": # create dir # current_time = datetime.now().strftime("%Y%m%d%H%M%S") # scan_result_path = os.path.join(scan_result_base_path, current_time) - scan_result_path = scan_result_base_path - if not os.path.exists(scan_result_path): - os.makedirs(scan_result_path) - for file in all_file_path: + # scan_result_path = scan_result_base_path + # if not os.path.exists(scan_result_path): + # os.makedirs(scan_result_path) + for file in all_file_path: cmd = f"clang-query-10 -p {compile_commands_path} {file} -f {clang_scan_rules_path}" logger.debug(f"cmd:{cmd}") try: @@ -195,9 +195,9 @@ if __name__ == "__main__": match_num = int(lines[-2].split(" ")[0]) logger.info("The match lines of file %s: %s" % (file, match_num)) if match_num > 0: - logger.info(f"scan_result_path: {scan_result_path} ,file:{file}") - save_scan_res(scan_result_path, file, stdout, stderr) - index_tests = file_res_path.find(branch_name) + logger.info(f"log_file_path: {log_file_path} ,file:{file}") + save_scan_res(log_file_path, file, stdout, stderr) + index_tests = file_res_path.find("scan_log") if index_tests != -1: web_path_file = file_res_path[index_tests:] web_path_file = os.path.join(web_server, web_path_file) @@ -212,8 +212,8 @@ if __name__ == "__main__": # for item in res: # data += item[0] + "," + str(item[1]) + "\n" # logger.info("Csv data: %s" % data) - write_csv(os.path.join(scan_result_path, "scan_res.csv"), res) - scan_result_log = f"{scan_result_path}/scan_res.csv" + write_csv(os.path.join(log_file_path, "scan_res.csv"), res) + scan_result_log = f"{log_file_path}/scan_res.csv" # delete the first element of res res= res[1:] logger.info("The result of scan: \n") diff --git a/tests/script/tsim/mnode/basic3.sim b/tests/script/tsim/mnode/basic3.sim index 02650ba10d..ff7c44b67d 100644 --- a/tests/script/tsim/mnode/basic3.sim +++ b/tests/script/tsim/mnode/basic3.sim @@ -36,7 +36,7 @@ if $data(3)[4] != ready then goto step1 endi -print =============== step2: create mnode 2 +print =============== step2: create mnode 2 3 sql create mnode on dnode 2 sql create mnode on dnode 3 sql_error create mnode on dnode 4 @@ -115,7 +115,7 @@ if $data(3)[4] != ready then goto step41 endi -print =============== step5: stop dnode1 +print =============== step5: stop dnode2 system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode2 -s stop @@ -154,7 +154,7 @@ if $data(3)[4] != ready then goto step51 endi -print =============== step6: stop dnode1 +print =============== step6: stop dnode3 system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s stop diff --git a/tests/system-test/2-query/tsma.py b/tests/system-test/2-query/tsma.py index 29a7562b45..fccf6291b5 100644 --- a/tests/system-test/2-query/tsma.py +++ b/tests/system-test/2-query/tsma.py @@ -1504,9 +1504,9 @@ class TDTestCase: # max number of list is 4093: 4096 - 3 - 2(原始表tag个数) - 1(tbname) tdSql.execute('use db4096') - self.create_tsma('tsma_4050', 'db4096', 'stb0', self.generate_tsma_function_list_columns(4050), '5m',check_tsma_calculation=False) + self.create_tsma('tsma_4050', 'db4096', 'stb0', self.generate_tsma_function_list_columns(4050), '5m',check_tsma_calculation=True) - self.create_tsma('tsma_4090', 'db4096', 'stb0', self.generate_tsma_function_list_columns(4090), '6m',check_tsma_calculation=False) + self.create_tsma('tsma_4090', 'db4096', 'stb0', self.generate_tsma_function_list_columns(4090), '6m',check_tsma_calculation=True) self.create_error_tsma('tsma_4091', 'db4096', 'stb0', self.generate_tsma_function_list_columns(4091), '5m', -2147473856) #Too many columns