Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the same xdist group for heat equation tests #9351

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: GUI Test
if: inputs.test-type == 'gui-tests'
run: |
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --mpl --benchmark-disable tests/ert/ui_tests/gui
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --mpl --benchmark-disable tests/ert/ui_tests/gui --durations=25

- name: Upload artifact images
uses: actions/upload-artifact@v4
Expand All @@ -53,18 +53,18 @@ jobs:
- name: CLI Test
if: inputs.test-type == 'cli-tests'
run: |
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --maxprocesses=2 -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --maxprocesses=2 -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli --durations=25

- name: Unit Test
if: inputs.test-type == 'unit-tests'
run: |
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --mpl --dist loadgroup tests/ert/unit_tests
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --mpl --dist loadgroup tests/ert/unit_tests --durations=25
pytest --doctest-modules --cov=ert --cov-report=xml:cov2.xml src/ --ignore src/ert/dark_storage

- name: Performance Test
if: inputs.test-type == 'performance-tests'
run: |
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --dist loadgroup tests/ert/performance_tests
pytest --cov=ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --dist loadgroup tests/ert/performance_tests --durations=25

- name: Test for a clean repository
run: |
Expand Down
5 changes: 5 additions & 0 deletions tests/ert/ui_tests/cli/analysis/test_adaptive_localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def run_cli_ES_with_case(poly_config):
return prior_ensemble, posterior_ensemble


@pytest.mark.xdist_group(name="heat_equation_storage")
@pytest.mark.timeout(600)
@pytest.mark.usefixtures("copy_poly_case")
def test_that_adaptive_localization_with_cutoff_1_equals_ensemble_prior():
Expand Down Expand Up @@ -60,6 +61,7 @@ def test_that_adaptive_localization_with_cutoff_1_equals_ensemble_prior():
assert np.allclose(posterior_sample, prior_sample)


@pytest.mark.xdist_group(name="heat_equation_storage")
@pytest.mark.timeout(600)
@pytest.mark.usefixtures("copy_poly_case")
def test_that_adaptive_localization_works_with_a_single_observation():
Expand Down Expand Up @@ -97,6 +99,7 @@ def test_that_adaptive_localization_works_with_a_single_observation():
_, _ = run_cli_ES_with_case("poly_localization_0.ert")


@pytest.mark.xdist_group(name="heat_equation_storage")
@pytest.mark.timeout(600)
@pytest.mark.usefixtures("copy_poly_case")
def test_that_adaptive_localization_works_with_multiple_observations(snapshot):
Expand Down Expand Up @@ -217,6 +220,7 @@ def _evaluate(coeffs, x):
assert set(map(tuple, records_from_pl)) == expected_records


@pytest.mark.xdist_group(name="heat_equation_storage")
@pytest.mark.timeout(600)
@pytest.mark.usefixtures("copy_poly_case")
def test_that_adaptive_localization_with_cutoff_0_equals_ESupdate():
Expand Down Expand Up @@ -255,6 +259,7 @@ def test_that_adaptive_localization_with_cutoff_0_equals_ESupdate():
assert np.allclose(posterior_sample_loc0, posterior_sample_noloc, atol=1e-6)


@pytest.mark.xdist_group(name="heat_equation_storage")
@pytest.mark.timeout(600)
@pytest.mark.usefixtures("copy_poly_case")
def test_that_posterior_generalized_variance_increases_in_cutoff():
Expand Down
6 changes: 6 additions & 0 deletions tests/ert/ui_tests/cli/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@
@pytest.fixture(autouse=True)
def reduce_omp_num_threads_count():
old_omp_num_threads = os.environ.get("OMP_NUM_THREADS")
old_polars_max_thread = os.environ.get("POLARS_MAX_THREADS")
os.environ["OMP_NUM_THREADS"] = "1"
os.environ["POLARS_MAX_THREADS"] = "1"

yield

if old_omp_num_threads is None:
del os.environ["OMP_NUM_THREADS"]
else:
os.environ["OMP_NUM_THREADS"] = old_omp_num_threads
if old_polars_max_thread is None:
del os.environ["POLARS_MAX_THREADS"]
else:
os.environ["POLARS_MAX_THREADS"] = old_polars_max_thread
3 changes: 3 additions & 0 deletions tests/ert/ui_tests/cli/test_field_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from .run_cli import run_cli


@pytest.mark.timeout(600)
@pytest.mark.xdist_group(name="heat_equation_storage")
def test_field_param_update_using_heat_equation(heat_equation_storage):
config = ErtConfig.from_file("config.ert")
with open_storage(config.ens_path, mode="w") as storage:
Expand Down Expand Up @@ -223,6 +225,7 @@ def test_parameter_update_with_inactive_cells_xtgeo_grdecl(tmpdir):


@pytest.mark.timeout(600)
@pytest.mark.xdist_group(name="heat_equation_storage")
@pytest.mark.filterwarnings("ignore:.*Cross-correlation.*:")
@pytest.mark.filterwarnings("ignore:.*divide by zero.*:")
def test_field_param_update_using_heat_equation_zero_var_params_and_adaptive_loc(
Expand Down
1 change: 1 addition & 0 deletions tests/ert/ui_tests/gui/test_plotting_of_snake_oil.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
("SNAKE_OIL_PARAM:OP1_OCTAVES", HISTOGRAM, "snake_oil"),
],
)
@pytest.mark.xdist_group(name="heat_equation_storage")
def plot_figure(qtbot, heat_equation_storage, snake_oil_case_storage, request):
key, plot_name, storage_type = request.param
args_mock = Mock()
Expand Down