Skip to content

Commit

Permalink
Have integration tests run with both scheduler and job queue (#6787)
Browse files Browse the repository at this point in the history
* Move integration tests to separate directory

This commit moves all integration tests (the ones marked with pytest.mark.integration_tests atleast) to a new directory tests/integration_tests.

* Have integration tests run with both queue and scheduler

This commits adds the pytest.mark.scheduler mark and scheduler fixture to some of the integration tests, so that they will be ran with both the scheduler and job queue.

* Move pytest snapshots down one level
  • Loading branch information
jonathan-eq authored Dec 20, 2023
1 parent 5d32855 commit a810eb0
Show file tree
Hide file tree
Showing 28 changed files with 2,418 additions and 1,708 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
======================================================================================================================================================
Time:
Parent ensemble: default_0
Target ensemble: new_ensemble
Alpha: 3.0
Global scaling: 1.0
Standard cutoff: 1e-06
Run id: id
Update step: DISABLED_OBSERVATIONS
------------------------------------------------------------------------------------------------------------------------------------------------------
Observed history | Simulated data | Status
------------------------------------------------------------------------------------------------------------------------------------------------------
1 : FOPR 0.008 +/- 0.100 | 0.079 +/- 0.107 | Active
2 : WPR_DIFF_1 0.000 +/- 0.100 | -0.011 +/- 0.060 | Active
3 : WPR_DIFF_1 0.100 +/- 0.200 | 0.081 +/- 0.126 | Active
4 : WPR_DIFF_1 0.200 +/- 0.150 | 0.073 +/- 0.130 | Active
5 : WPR_DIFF_1 0.000 +/- 0.050 | 0.127 +/- 0.125 | Active

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ def run_cli_ES_with_case(poly_config):
return prior_sample, posterior_sample


@pytest.mark.scheduler
@pytest.mark.integration_test
def test_that_adaptive_localization_with_cutoff_1_equals_ensemble_prior(copy_poly_case):
def test_that_adaptive_localization_with_cutoff_1_equals_ensemble_prior(
copy_poly_case, try_queue_and_scheduler, monkeypatch
):
set_adaptive_localization_1 = dedent(
"""
ANALYSIS_SET_VAR STD_ENKF LOCALIZATION True
Expand All @@ -65,8 +68,11 @@ def test_that_adaptive_localization_with_cutoff_1_equals_ensemble_prior(copy_pol
assert np.allclose(posterior_sample, prior_sample)


@pytest.mark.scheduler
@pytest.mark.integration_test
def test_that_adaptive_localization_with_cutoff_0_equals_ESupdate(copy_poly_case):
def test_that_adaptive_localization_with_cutoff_0_equals_ESupdate(
copy_poly_case, try_queue_and_scheduler, monkeypatch
):
"""
Note that "RANDOM_SEED" in both ert configs needs to be the same to obtain
the same sample from the prior.
Expand Down Expand Up @@ -101,8 +107,11 @@ def test_that_adaptive_localization_with_cutoff_0_equals_ESupdate(copy_poly_case
assert np.allclose(posterior_sample_loc0, posterior_sample_noloc)


@pytest.mark.scheduler
@pytest.mark.integration_test
def test_that_posterior_generalized_variance_increases_in_cutoff(copy_poly_case):
def test_that_posterior_generalized_variance_increases_in_cutoff(
copy_poly_case, try_queue_and_scheduler, monkeypatch
):
rng = np.random.default_rng(42)
cutoff1 = rng.uniform(0, 1)
cutoff2 = rng.uniform(cutoff1, 1)
Expand Down
Loading

0 comments on commit a810eb0

Please sign in to comment.