|
13 | 13 | get_termination_timeout_secs,
|
14 | 14 | prepare_benchmark_definitions,
|
15 | 15 | process_benchmark_definitions_remote_timeouts,
|
| 16 | + get_testfiles_to_process, |
16 | 17 | )
|
17 | 18 |
|
18 | 19 |
|
@@ -196,7 +197,7 @@ def test_prepare_benchmark_definitions():
|
196 | 197 | clusterconfig,
|
197 | 198 | ) = prepare_benchmark_definitions(args)
|
198 | 199 | assert result == True
|
199 |
| - assert len(benchmark_definitions.keys()) == 2 |
| 200 | + assert len(benchmark_definitions.keys()) == 6 |
200 | 201 |
|
201 | 202 |
|
202 | 203 | def test_process_benchmark_definitions_remote_timeouts():
|
@@ -224,10 +225,41 @@ def test_process_benchmark_definitions_remote_timeouts():
|
224 | 225 | clusterconfig,
|
225 | 226 | ) = prepare_benchmark_definitions(args)
|
226 | 227 | assert result == True
|
227 |
| - assert len(benchmark_definitions.keys()) == 2 |
| 228 | + assert len(benchmark_definitions.keys()) == 6 |
228 | 229 | remote_envs_timeout = process_benchmark_definitions_remote_timeouts(
|
229 | 230 | benchmark_definitions
|
230 | 231 | )
|
231 |
| - assert len(remote_envs_timeout.keys()) == 1 |
| 232 | + assert len(remote_envs_timeout.keys()) == 2 |
232 | 233 | # we have the default timeout + the one specified
|
233 | 234 | assert list(remote_envs_timeout.values())[0] == 600 + 1200
|
| 235 | + |
| 236 | + |
| 237 | +def test_get_testfiles_to_process(): |
| 238 | + test_glob_pattern_all = "./tests/test_data/benchmark_definitions/*.yml" |
| 239 | + test_glob_pattern_graph500 = "./tests/test_data/benchmark_definitions/graph500*.yml" |
| 240 | + test_files_to_process = get_testfiles_to_process( |
| 241 | + test_glob_pattern_all, "", "defaults.yml" |
| 242 | + ) |
| 243 | + assert 6 == len(test_files_to_process) |
| 244 | + test_files_to_process_graph500_glob = get_testfiles_to_process( |
| 245 | + test_glob_pattern_graph500, "", "defaults.yml" |
| 246 | + ) |
| 247 | + assert 3 == len(test_files_to_process_graph500_glob) |
| 248 | + test_files_to_process = get_testfiles_to_process( |
| 249 | + "./tests/test_data/benchmark_definitions/*.yml", |
| 250 | + "", |
| 251 | + "defaults.yml", |
| 252 | + "graph500.+.yml", |
| 253 | + ) |
| 254 | + assert 3 == len(test_files_to_process) |
| 255 | + assert test_files_to_process_graph500_glob == test_files_to_process |
| 256 | + |
| 257 | + test_files_to_process = get_testfiles_to_process( |
| 258 | + "./tests/test_data/benchmark_definitions/*.yml", |
| 259 | + "", |
| 260 | + "defaults.yml", |
| 261 | + "^(?!.*graph500).*.yml", |
| 262 | + ) |
| 263 | + assert 3 == len(test_files_to_process) |
| 264 | + for test_graph in test_files_to_process_graph500_glob: |
| 265 | + assert test_graph not in test_files_to_process |
0 commit comments