Skip to content

Commit

Permalink
Test unit_tests/cli with queue and scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Dec 18, 2023
1 parent af717e2 commit 6e05161
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions tests/unit_tests/cli/test_integration_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,10 @@ def test_field_init_file_not_readable(copy_case, monkeypatch):
assert "Permission denied:" in str(err)


def test_surface_init_fails_during_forward_model_callback(copy_case):
@pytest.mark.scheduler
def test_surface_init_fails_during_forward_model_callback(
copy_case, monkeypatch, try_queue_and_scheduler
):
copy_case("snake_oil_field")

rng = np.random.default_rng()
Expand Down Expand Up @@ -645,7 +648,10 @@ def test_that_the_model_raises_exception_if_active_less_than_minimum_realization


@pytest.mark.usefixtures("copy_poly_case")
def test_that_the_model_warns_when_active_realizations_less_min_realizations():
@pytest.mark.scheduler
def test_that_the_model_warns_when_active_realizations_less_min_realizations(
monkeypatch, try_queue_and_scheduler
):
"""
Verify that the run model checks that active realizations is equal or higher than
NUM_REALIZATIONS when running ensemble_experiment.
Expand Down Expand Up @@ -765,13 +771,19 @@ def setenv_config(tmp_path):
}


def test_that_setenv_config_is_parsed_correctly(setenv_config):
@pytest.mark.scheduler
def test_that_setenv_config_is_parsed_correctly(
setenv_config, monkeypatch, try_queue_and_scheduler
):
config = ErtConfig.from_file(str(setenv_config))
# then res config should read the SETENV as is
assert config.env_vars == expected_vars


def test_that_setenv_sets_environment_variables_in_jobs(setenv_config):
@pytest.mark.scheduler
def test_that_setenv_sets_environment_variables_in_jobs(
setenv_config, monkeypatch, try_queue_and_scheduler
):
# When running the jobs
parser = ArgumentParser(prog="test_main")
parsed = ert_parser(
Expand Down Expand Up @@ -954,8 +966,14 @@ def run(self):
),
],
)
@pytest.mark.scheduler
def test_that_stop_on_fail_workflow_jobs_stop_ert(
job_src, script_name, script_src, expect_stopped
job_src,
script_name,
script_src,
expect_stopped,
monkeypatch,
try_queue_and_scheduler,
):
with open("failing_job", "w", encoding="utf-8") as f:
f.write(job_src)
Expand Down

0 comments on commit 6e05161

Please sign in to comment.