已合并
op_plugin ut exclude common npu files among branches #37688
fengyixing创建于 6月5日
op_plugin ut exclude common npu files among branches #37688
已合并
fengyixing创建于 6月5日
2 个文件变更+11-0
Mci/access_control/test_manager.py+8-0
@@ -102,6 +102,14 @@ class TestMgr:
102 self.test_files['ut_files'] = ordered_split(self.test_files['ut_files'], rank - 1, world_size)102 self.test_files['ut_files'] = ordered_split(self.test_files['ut_files'], rank - 1, world_size)
103 self.test_files['op_ut_files'] = ordered_split(self.test_files['op_ut_files'], rank - 1, world_size)103 self.test_files['op_ut_files'] = ordered_split(self.test_files['op_ut_files'], rank - 1, world_size)
104 104 
105+ def exclude_files_from_list(self, exclude_list_file):
106+ with open(exclude_list_file) as f:
107+ exclude_names = {line.strip() for line in f if line.strip()}
108+ self.test_files['ut_files'] = [
109+ f for f in self.test_files['ut_files']
110+ if Path(f).name not in exclude_names
111+ ]
112+ 
105 def exclude_test_files(self, slow_files=None, not_run_files=None, mode="slow_test"):113 def exclude_test_files(self, slow_files=None, not_run_files=None, mode="slow_test"):
106 """114 """
107 Args:115 Args:
Mci/access_control_test.py+3-0
@@ -198,6 +198,9 @@ if __name__ == "__main__":
198 else:198 else:
199 test_mgr.load_core_ut()199 test_mgr.load_core_ut()
200 test_mgr.exclude_test_files(not_run_files=NOT_RUN_DIRECTLY, mode="not_run_directly")200 test_mgr.exclude_test_files(not_run_files=NOT_RUN_DIRECTLY, mode="not_run_directly")
201+ common_files = str(BASE_DIR / 'common_files.txt')
202+ if os.path.exists(common_files):
203+ test_mgr.exclude_files_from_list(common_files)
201 204 
202 if options.rank > 0 and options.world_size > 0:205 if options.rank > 0 and options.world_size > 0:
203 test_mgr.split_test_files(options.rank, options.world_size)206 test_mgr.split_test_files(options.rank, options.world_size)