Skip to content

Commit 9d7361e

Browse files
committed
Add QUEUE_SYSTEM LOCAL to minimal tests
This is to avoid the possibility for any site-configuration to interfere with where minimal Ert configurations actually run
1 parent 56ec2c7 commit 9d7361e

2 files changed

Lines changed: 27 additions & 15 deletions

File tree

tests/ert/ui_tests/gui/test_main_window.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,9 @@ def handle_error_dialog(run_dialog):
647647
def test_that_gui_plotter_works_when_no_data(qtbot, monkeypatch, use_tmpdir):
648648
monkeypatch.setattr(PlotApi, "get_all_ensembles", lambda _: [])
649649
config_file = "minimal_config.ert"
650-
with open(config_file, "w", encoding="utf-8") as f:
651-
f.write("NUM_REALIZATIONS 1\n")
652-
f.write("ENSPATH storage")
650+
Path(config_file).write_text(
651+
"NUM_REALIZATIONS 1\nENSPATH storage\nQUEUE_SYSTEM LOCAL", encoding="utf-8"
652+
)
653653

654654
args_mock = Mock()
655655
args_mock.config = config_file
@@ -682,9 +682,9 @@ def test_that_gui_plotter_works_when_no_data(qtbot, monkeypatch, use_tmpdir):
682682
def test_right_click_plot_button_opens_external_plotter(qtbot, use_tmpdir, monkeypatch):
683683
monkeypatch.setattr(PlotApi, "get_all_ensembles", lambda _: [])
684684
config_file = "minimal_config.ert"
685-
with open(config_file, "w", encoding="utf-8") as f:
686-
f.write("NUM_REALIZATIONS 1\n")
687-
f.write("ENSPATH storage")
685+
Path(config_file).write_text(
686+
"NUM_REALIZATIONS 1\nENSPATH storage\nQUEUE_SYSTEM LOCAL", encoding="utf-8"
687+
)
688688

689689
# Open up storage to create it, so that dark storage can be mounted onto it
690690
# Not creating will result in dark storage hanging/lagging

tests/ert/unit_tests/gui/simulation/test_run_dialog.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ def run_dialog(qtbot: QtBot, use_tmpdir, mock_set_env_key, monkeypatch):
126126
monkeypatch.setattr(
127127
"ert.ensemble_evaluator.EnsembleEvaluator.BATCHING_INTERVAL", 0.01
128128
)
129-
Path(config_file).write_text("NUM_REALIZATIONS 1", encoding="utf-8")
129+
Path(config_file).write_text(
130+
"NUM_REALIZATIONS 1\nQUEUE_SYSTEM LOCAL", encoding="utf-8"
131+
)
130132
args_mock = Mock()
131133
args_mock.config = config_file
132134
ert_config = ErtConfig.from_file(config_file)
@@ -593,7 +595,9 @@ def test_that_exception_in_run_model_is_displayed_in_a_suggestor_window_after_si
593595
qtbot: QtBot, use_tmpdir
594596
):
595597
config_file = "minimal_config.ert"
596-
Path(config_file).write_text("NUM_REALIZATIONS 1", encoding="utf-8")
598+
Path(config_file).write_text(
599+
"NUM_REALIZATIONS 1\nQUEUE_SYSTEM LOCAL", encoding="utf-8"
600+
)
597601
args_mock = Mock()
598602
args_mock.config = config_file
599603

@@ -735,10 +739,13 @@ def test_that_design_matrix_show_parameters_button_is_visible(
735739
design_matrix_df.to_excel(xl_write, index=False, sheet_name="DesignSheet")
736740

737741
config_file = "minimal_config.ert"
738-
with open(config_file, "w", encoding="utf-8") as f:
739-
f.write("NUM_REALIZATIONS 1")
740-
if design_matrix_entry:
741-
f.write(f"\nDESIGN_MATRIX {xls_filename}")
742+
design_matrix_config = (
743+
f"\nDESIGN_MATRIX {xls_filename}" if design_matrix_entry else ""
744+
)
745+
Path(config_file).write_text(
746+
"NUM_REALIZATIONS 1\nQUEUE_SYSTEM LOCAL" + design_matrix_config,
747+
encoding="utf-8",
748+
)
742749

743750
args_mock = Mock()
744751
args_mock.config = config_file
@@ -917,9 +924,14 @@ def test_that_ert_chooses_minimum_realization_with_design_matrix(
917924
config_num_realizations = 10
918925
expected_num_realizations = min(dm_realizations, config_num_realizations)
919926
config_file = "minimal_config.ert"
920-
with open(config_file, "w", encoding="utf-8") as f:
921-
f.write(f"NUM_REALIZATIONS {config_num_realizations}")
922-
f.write(f"\nDESIGN_MATRIX {xls_filename}")
927+
Path(config_file).write_text(
928+
(
929+
f"NUM_REALIZATIONS {config_num_realizations}\n"
930+
f"DESIGN_MATRIX {xls_filename}\n"
931+
"QUEUE_SYSTEM LOCAL"
932+
),
933+
encoding="utf-8",
934+
)
923935

924936
args_mock = Mock()
925937
args_mock.config = config_file

0 commit comments

Comments
 (0)