diff --git a/test/conftest.py b/test/conftest.py index 8db24b86aaaff33c95b0be6eb620b7276a2583aa..e844f1a6b6ccce69b3409943581a7c607027569f 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -4,7 +4,7 @@ import os, subprocess class KTH_WL: swf_file = "workloads/KTH-SP2-1996-2.1-cln.swf" nb_users = 214 - nb_jobs = 28476 + nb_jobs = 28475 thresholds = [0, 30, 1440] @@ -17,7 +17,7 @@ def create_dir_rec_if_needed(dirname): def run_script(delim, threshold, input_swf=KTH_WL.swf_file, test_name=None, - dyn_red=True, graph=False): + dyn_red=True, graph=False, given_walltime_only=False): if test_name is None: if input_swf == KTH_WL.swf_file: pfx = "KTH" @@ -31,11 +31,13 @@ def run_script(delim, threshold, create_dir_rec_if_needed(out_dir) args = ['python3', 'swf2userSessions.py', f'--{delim}', str(threshold), - '-q', '--given_walltime_only', input_swf, out_dir] + '-q', input_swf, out_dir] if graph: args.append("--graph") if not dyn_red: args.append("--no_dynamic_reduction") + if given_walltime_only: + args.append('--given_walltime_only') cp = subprocess.run(args, check=True) diff --git a/test/test_expected_outputs.py b/test/test_expected_outputs.py index 31baeef5ea0fc38dc699d2d8c2e29982a1e1a416..8be2fb43f835d87baf838272f196505d8e0243cd 100644 --- a/test/test_expected_outputs.py +++ b/test/test_expected_outputs.py @@ -49,24 +49,28 @@ def test_example_workload(): """Simple tests with example workload""" test_name = "example_arrival_t60" - run_script(delim="arrival", threshold=60, input_swf="workloads/example.swf") + run_script(delim="arrival", threshold=60, given_walltime_only=True, + input_swf="workloads/example.swf") compare_with_expected_output(test_name) test_name = "example_arrival_t0" - run_script(delim="arrival", threshold=0, input_swf="workloads/example.swf") + run_script(delim="arrival", threshold=0, given_walltime_only=True, + input_swf="workloads/example.swf") compare_with_expected_output(test_name) test_name = "example_arrival_t0_nodyn" - run_script(delim="arrival", threshold=0, input_swf="workloads/example.swf", - dyn_red=False) + run_script(delim="arrival", threshold=0, given_walltime_only=True, + input_swf="workloads/example.swf", dyn_red=False) compare_with_expected_output(test_name) test_name = "example_max_t0" - run_script(delim="max", threshold=0, input_swf="workloads/example.swf") + run_script(delim="max", threshold=0, given_walltime_only=True, + input_swf="workloads/example.swf") compare_with_expected_output(test_name) test_name = "example_last_t30" - run_script(delim="last", threshold=30, input_swf="workloads/example.swf") + run_script(delim="last", threshold=30, given_walltime_only=True, + input_swf="workloads/example.swf") compare_with_expected_output(test_name) def test_edge_cases(): @@ -74,32 +78,32 @@ def test_edge_cases(): Same tests than in batmen.""" test_name = "load_platform" - run_script(delim="arrival", threshold=10, + run_script(delim="arrival", threshold=10, given_walltime_only=True, input_swf=f"test/workload/{test_name}.swf", test_name=test_name) compare_with_expected_output(test_name) test_name = "many_following" - run_script(delim="arrival", threshold=0, + run_script(delim="arrival", threshold=0, given_walltime_only=True, input_swf=f"test/workload/{test_name}.swf", test_name=test_name) compare_with_expected_output(test_name) test_name = "many_preceding" - run_script(delim="arrival", threshold=0, + run_script(delim="arrival", threshold=0, given_walltime_only=True, input_swf=f"test/workload/{test_name}.swf", test_name=test_name) compare_with_expected_output(test_name) test_name = "no_session" - run_script(delim="max", threshold=42, + run_script(delim="max", threshold=42, given_walltime_only=True, input_swf=f"test/workload/{test_name}.swf", test_name=test_name) with pytest.raises(FileNotFoundError): load_expected_output(test_name) test_name = "one_session_many_jobs" - run_script(delim="last", threshold=10, + run_script(delim="last", threshold=10, given_walltime_only=True, input_swf=f"test/workload/{test_name}.swf", test_name=test_name) compare_with_expected_output(test_name) test_name = "zero_think_time" - run_script(delim="last", threshold=0, + run_script(delim="last", threshold=0, given_walltime_only=True, input_swf=f"test/workload/{test_name}.swf", test_name=test_name) compare_with_expected_output(test_name) \ No newline at end of file