Skip to content

Commit

Permalink
Remove asserts from integration test
Browse files Browse the repository at this point in the history
The integration for rft is not setup to properly run with ert. The
single realisation will cause ert to fail with "no ensemble variation".
Ert used to continue with the second iteration, but now stops (as it
should). We only make sure that we do not get any errors when GEN_DATA
tries to load the file (e.g. syntax error in input, incorrect filename
etc).
  • Loading branch information
lars-petter-hauge committed Apr 29, 2022
1 parent d5864e4 commit 52dd0cf
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions tests/jobs/rft/test_gendata_rft.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def test_ert_setup_one_well_one_rft_point(tmpdir):
)

# Chosen filename syntax for obs file: <wellname>_<report_step>.obs
Path("observations/OP_1_1.obs").write_text("200 1")
Path("observations/OP_1_1.obs").write_text("304 1")
# measured pressure, abs error

# Time-map needed for loading observations with no summary file. It seems we need
Expand Down Expand Up @@ -555,17 +555,12 @@ def test_ert_setup_one_well_one_rft_point(tmpdir):
assert "gen_obs_assert_data_size: size mismatch" not in stdouterr

# This is probably an 'ok' from the smoother, as there are no parameters involved:
assert "Deactivating: OP_1_OBS1" in stdouterr
assert "Simulations completed" in stdouterr
assert "Deactivating: OP_1_OBS1(0) : No ensemble variation" in stdouterr

# Asserts on GENDATA_RFT output:
assert Path("realization-0/iter-0/RFT_OP_1_1").is_file()
assert Path("realization-0/iter-1/RFT_OP_1_1").is_file()

assert Path("realization-0/iter-0/OK").is_file()
assert Path("realization-0/iter-1/OK").is_file()

assert result.returncode == 0


@pytest.mark.ert_integration
Expand Down Expand Up @@ -609,15 +604,13 @@ def test_ert_setup_one_well_two_points_different_time_and_depth(tmpdir):
)

# Chosen filename syntax for obs file: <wellname>_<report_step>.obs
Path("observations/OP_1_1.obs").write_text("200 1\n-1 0\n")
Path("observations/OP_1_2.obs").write_text("-1 0.1\n190 1\n")
Path("observations/OP_1_1.obs").write_text("304 1\n-1 0\n")
Path("observations/OP_1_2.obs").write_text("-1 0.1\n249 1\n")
# measured pressure, abs error

# Time-map needed for loading observations with no summary file. It seems we need
# one date for start-date, and one date for every report_step in use.
Path("time_map.txt").write_text(
"2000-01-01\n2000-02-01\n2001-01-01"
)
Path("time_map.txt").write_text("2000-01-01\n2000-02-01\n2001-01-01")

# Write an ERT config file
Path("config.ert").write_text(
Expand Down Expand Up @@ -664,14 +657,9 @@ def test_ert_setup_one_well_two_points_different_time_and_depth(tmpdir):
assert "gen_obs_assert_data_size: size mismatch" not in stdouterr

# This is probably an 'ok' from the smoother, as there are no parameters involved:
assert "Deactivating: OP_1_OBS1" in stdouterr
assert "Simulations completed" in stdouterr
assert "Deactivating: OP_1_OBS1(0) : No ensemble variation" in stdouterr

# Asserts on GENDATA_RFT output:
assert Path("realization-0/iter-0/gendata_rft/RFT_OP_1_1").is_file()
assert Path("realization-0/iter-1/gendata_rft/RFT_OP_1_1").is_file()

assert Path("realization-0/iter-0/OK").is_file()
assert Path("realization-0/iter-1/OK").is_file()

assert result.returncode == 0

0 comments on commit 52dd0cf

Please sign in to comment.