Skip to content

Commit 4a83abc

Browse files
committed
Run long-running pytests out of the bundle
1 parent 1520518 commit 4a83abc

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

test/pytest/generate_ci_yaml.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020

2121
n_test_files_per_yml = int(os.environ.get('N_TESTS_PER_YAML', 4))
2222

23+
# Blacklisted tests will be skipped
2324
BLACKLIST = {'test_reduction'}
2425

26+
# Long-running tests will not be bundled with other tests
27+
LONGLIST = {'test_hgq_layers'}
28+
2529

2630
def path_to_name(test_path):
2731
path = Path(test_path)
@@ -43,9 +47,7 @@ def uses_example_model(test_filename):
4347

4448
def generate_test_yaml(test_root='.'):
4549
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)]
4951
need_example_models = [uses_example_model(path) for path in test_paths]
5052

5153
idxs = list(range(len(need_example_models)))
@@ -63,6 +65,15 @@ def generate_test_yaml(test_root='.'):
6365
yml = diff_yml
6466
else:
6567
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+
6677
return yml
6778

6879

0 commit comments

Comments
 (0)