diff --git a/tests/end_to_end/cucumber/features/Benders_criterion_output_tests.feature b/tests/end_to_end/cucumber/features/Benders_criterion_output_tests.feature index 3cb32f136..02320906e 100644 --- a/tests/end_to_end/cucumber/features/Benders_criterion_output_tests.feature +++ b/tests/end_to_end/cucumber/features/Benders_criterion_output_tests.feature @@ -4,8 +4,8 @@ Feature: Benders Criterion files Scenario: xpansion-test-01 Given the study path is "data_test/examples/xpansion-test-01" When I run antares-xpansion with the benders method and 1 proc(s) - Then the simulation succeeds - And the simulation takes less than 300 seconds + Then the simulation takes less than 300 seconds + And the simulation succeeds And the expected positive unsupplied energy is | Outer loop | Ite | area1 | area2 | flex | peak | pv | semibase | store_in | store_out | | 0 | 1 | 5.3771400000e+05 | 4.3137090000e+06 | 0.0000000000e+00 | 0.0000000000e+00 | 0.0000000000e+00 | 0.0000000000e+00 | 2.6208000000e+07 | 0.0000000000e+00 | diff --git a/tests/end_to_end/cucumber/features/outer_loop_tests.feature b/tests/end_to_end/cucumber/features/outer_loop_tests.feature index 3161061af..daa53a3c5 100644 --- a/tests/end_to_end/cucumber/features/outer_loop_tests.feature +++ b/tests/end_to_end/cucumber/features/outer_loop_tests.feature @@ -4,8 +4,8 @@ Feature: outer loop tests Scenario: a system with 4 nodes, on 1 timestep, 2 scenarios Given the study path is "data_test/external_loop_test" When I run outer loop with 1 proc(s) - Then the simulation succeeds - And the simulation takes less than 5 seconds + Then the simulation takes less than 5 seconds + And the simulation succeeds And the expected overall cost is 92.70005 And the solution is | variable | value | diff --git a/tests/end_to_end/cucumber/features/steps/steps.py b/tests/end_to_end/cucumber/features/steps/steps.py index 76e6b9077..128e714a6 100644 --- a/tests/end_to_end/cucumber/features/steps/steps.py +++ b/tests/end_to_end/cucumber/features/steps/steps.py @@ -83,20 +83,19 @@ def run_antares_xpansion(context, method, memory=None, n: int = 1): context.return_code = run_command(context.tmp_study, memory=memory, method=method, n_mpi=n, allow_run_as_root=get_conf("allow_run_as_root")) - if context.return_code == 0: - output_path = context.tmp_study / "output" - outputs = read_outputs(output_path, use_archive=not memory, lold=True, positive_unsupplied_energy=True) - context.outputs = outputs.out_json - context.options_data = outputs.options_json - context.lold = outputs.lold - context.positive_unsupplied_energy = outputs.positive_unsupplied_energy + output_path = context.tmp_study / "output" + outputs = read_outputs(output_path, use_archive=not memory, lold=True, positive_unsupplied_energy=True) + context.outputs = outputs.out_json + context.options_data = outputs.options_json + context.lold = outputs.lold + context.positive_unsupplied_energy = outputs.positive_unsupplied_energy def run_command(study_path, memory, method, n_mpi, allow_run_as_root=False): command = build_launch_command(study_path, method, nproc=n_mpi, in_memory=memory, allow_run_as_root=allow_run_as_root) print(f"Running command: {command}") - process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) out, err = process.communicate() if process.returncode != 0: print("*********************** Begin stdout ***********************") diff --git a/tests/end_to_end/utils_functions.py b/tests/end_to_end/utils_functions.py index 982ad475b..7a87581f2 100644 --- a/tests/end_to_end/utils_functions.py +++ b/tests/end_to_end/utils_functions.py @@ -47,12 +47,10 @@ def remove_outputs(study_path): def get_filepath(output_dir, folder, filename): op = [] - assert Path(output_dir).exists() for path in Path(output_dir).iterdir(): - assert Path(path / folder).exists() - for jsonpath in Path(path / folder).rglob( filename): + for jsonpath in Path(path / folder).rglob(filename): op.append(jsonpath) - assert len(op) == 1 + assert len(op) == 1 return op[0]