File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 20
20
21
21
n_test_files_per_yml = int (os .environ .get ('N_TESTS_PER_YAML' , 4 ))
22
22
23
+ # Blacklisted tests will be skipped
23
24
BLACKLIST = {'test_reduction' }
24
25
26
+ # Long-running tests will not be bundled with other tests
27
+ LONGLIST = {'test_hgq_layers' }
28
+
25
29
26
30
def path_to_name (test_path ):
27
31
path = Path (test_path )
@@ -43,9 +47,7 @@ def uses_example_model(test_filename):
43
47
44
48
def generate_test_yaml (test_root = '.' ):
45
49
test_root = Path (test_root )
46
- test_paths = [path for path in test_root .glob ('**/test_*.py' ) if path .stem not in BLACKLIST ]
47
- for path in test_paths :
48
- print (path .name )
50
+ test_paths = [path for path in test_root .glob ('**/test_*.py' ) if path .stem not in (BLACKLIST | LONGLIST )]
49
51
need_example_models = [uses_example_model (path ) for path in test_paths ]
50
52
51
53
idxs = list (range (len (need_example_models )))
@@ -63,6 +65,15 @@ def generate_test_yaml(test_root='.'):
63
65
yml = diff_yml
64
66
else :
65
67
yml .update (diff_yml )
68
+
69
+ test_paths = [path for path in test_root .glob ('**/test_*.py' ) if path .stem in LONGLIST ]
70
+ for path in test_paths :
71
+ name = path .stem .replace ('test_' , '' )
72
+ test_file = str (path .relative_to (test_root ))
73
+ needs_examples = uses_example_model (path )
74
+ diff_yml = yaml .safe_load (template .format (name , test_file , needs_examples ))
75
+ yml .update (diff_yml )
76
+
66
77
return yml
67
78
68
79
You can’t perform that action at this time.
0 commit comments