Skip to content

Commit 2839ae7

Browse files
committed
Skip slow tests in mac ci
1 parent 56f6ec4 commit 2839ae7

14 files changed

+29
-20
lines changed

.github/workflows/build_and_test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ jobs:
109109
test-type: [ 'performance-tests', 'unit-tests', 'gui-tests', 'cli-tests' ]
110110
python-version: [ '3.12' ]
111111
os: [ 'macos-latest']
112+
select-string: ['"not skip_mac_ci"']
112113

113114
uses: ./.github/workflows/test_ert.yml
114115
with:

.github/workflows/test_ert.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
type: string
88
test-type:
99
type: string
10+
select-string:
11+
type: string
12+
default: "''"
1013

1114
env:
1215
ERT_SHOW_BACKTRACE: 1
@@ -40,7 +43,7 @@ jobs:
4043
- name: GUI Test
4144
if: inputs.test-type == 'gui-tests'
4245
run: |
43-
pytest --cov=ert --cov=everest --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
46+
pytest -m ${{ inputs.select-string }} --cov=ert --cov=everest --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
4447
4548
- name: Upload artifact images
4649
uses: actions/upload-artifact@v4
@@ -53,18 +56,18 @@ jobs:
5356
- name: CLI Test
5457
if: inputs.test-type == 'cli-tests'
5558
run: |
56-
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli --durations=25
59+
pytest -m ${{ inputs.select-string }} --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli --durations=25
5760
5861
- name: Unit Test
5962
if: inputs.test-type == 'unit-tests'
6063
run: |
61-
pytest --cov=ert --cov=everest --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
64+
pytest -m ${{ inputs.select-string }} --cov=ert --cov=everest --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
6265
pytest --doctest-modules --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov2.xml src/ --ignore src/ert/dark_storage
6366
6467
- name: Performance Test
6568
if: inputs.test-type == 'performance-tests'
6669
run: |
67-
pytest --cov=ert --cov=everest --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
70+
pytest -m ${{ inputs.select-string }} --cov=ert --cov=everest --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
6871
6972
- name: Upload coverage to Codecov
7073
id: codecov1

.github/workflows/test_everest.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Run Tests macOS
4747
if: ${{ inputs.test-type == 'test' && runner.os == 'macOS'}}
4848
run: |
49-
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test and not fails_on_macos_github_workflow" --dist loadgroup -sv
49+
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test and not skip_mac_ci" --dist loadgroup -sv
5050
5151
- name: Run Integration Tests Linux
5252
if: ${{inputs.test-type == 'integration-test' && runner.os != 'macOS'}}
@@ -56,7 +56,7 @@ jobs:
5656
- name: Run Integration Tests macOS
5757
if: ${{inputs.test-type == 'integration-test' && runner.os == 'macOS'}}
5858
run: |
59-
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup
59+
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test and not skip_mac_ci" --dist loadgroup
6060
6161
- name: Build Documentation
6262
if: inputs.test-type == 'doc'

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ markers = [
171171
"slow",
172172
"everest_models_test",
173173
"integration_test",
174-
"fails_on_macos_github_workflow", # Tests marked fail due to gui-related issues
174+
"skip_mac_ci",
175175
]
176176
log_cli = "false"
177177
asyncio_mode = "auto"

tests/ert/ui_tests/cli/test_parameter_passing.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import xtgeo
2020
from hypothesis import given, note, settings
2121
from hypothesis.extra.numpy import arrays
22-
from pytest import MonkeyPatch, TempPathFactory
22+
from pytest import MonkeyPatch, TempPathFactory, mark
2323
from resdata import ResDataType
2424
from resdata.grid import GridGenerator
2525
from resdata.resfile import ResdataKW
@@ -409,6 +409,7 @@ def check(self, io_source: IoProvider, mask, num_realizations: int):
409409
max_size=3,
410410
),
411411
)
412+
@mark.skip_mac_ci # test is slow
412413
def test_that_parameters_are_placed_in_the_runpath_as_expected(
413414
io_source: IoProvider,
414415
grid_format: Literal["grid", "egrid"],

tests/ert/ui_tests/gui/test_plotting_of_snake_oil.py

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def plot_figure(qtbot, heat_equation_storage, snake_oil_case_storage, request):
121121
# The tolerance is chosen by guess, in one bug we observed a
122122
# mismatch of 58 which would fail the test by being above 10.0
123123
@pytest.mark.mpl_image_compare(tolerance=10.0)
124+
@pytest.mark.skip_mac_ci # test is slow
124125
def test_that_all_snake_oil_visualisations_matches_snapshot(plot_figure):
125126
return plot_figure
126127

tests/ert/unit_tests/dark_storage/test_dark_storage_state.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,6 @@ def teardown(self):
111111
del os.environ["ERT_STORAGE_ENS_PATH"]
112112

113113

114-
TestDarkStorage = pytest.mark.integration_test(DarkStorageStateTest.TestCase)
114+
TestDarkStorage = pytest.mark.skip_mac_ci(
115+
pytest.mark.integration_test(DarkStorageStateTest.TestCase)
116+
)

tests/ert/unit_tests/gui/model/test_snapshot.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111

1212
@pytest.mark.integration_test
13+
@pytest.mark.skip_mac_ci # slow
1314
def test_using_qt_model_tester(qtmodeltester, full_snapshot):
1415
model = SnapshotModel()
1516

tests/everest/entry_points/test_everexport.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def test_everexport_entry_empty(mocked_func, cached_example):
101101
side_effect=validate_export_mock,
102102
)
103103
@patch("everest.bin.utils.export_data")
104-
@pytest.mark.fails_on_macos_github_workflow
104+
@pytest.mark.skip_mac_ci
105105
def test_everexport_entry_batches(mocked_func, validate_export_mock, cached_example):
106106
"""Test running everexport with the --batches flag"""
107107
_, config_file, _ = cached_example("math_func/config_minimal.yml")
@@ -156,7 +156,7 @@ def test_everexport_entry_empty_export(mocked_func, cached_example):
156156

157157

158158
@patch("everest.bin.utils.export_data")
159-
@pytest.mark.fails_on_macos_github_workflow
159+
@pytest.mark.skip_mac_ci
160160
def test_everexport_entry_no_usr_def_ecl_keys(mocked_func, cached_example):
161161
"""Test running everexport with config file containing only the
162162
keywords label without any list of keys"""
@@ -190,7 +190,7 @@ def condition(config):
190190

191191

192192
@patch("everest.bin.utils.export_data")
193-
@pytest.mark.fails_on_macos_github_workflow
193+
@pytest.mark.skip_mac_ci
194194
def test_everexport_entry_internalized_usr_def_ecl_keys(mocked_func, cached_example):
195195
"""Test running everexport with config file containing a key in the
196196
list of user defined ecl keywords, that has been internalized on
@@ -226,7 +226,7 @@ def condition(config):
226226

227227

228228
@patch("everest.bin.utils.export_data")
229-
@pytest.mark.fails_on_macos_github_workflow
229+
@pytest.mark.skip_mac_ci
230230
def test_everexport_entry_non_int_usr_def_ecl_keys(mocked_func, caplog, cached_example):
231231
"""Test running everexport when config file contains non internalized
232232
ecl keys in the user defined keywords list"""
@@ -269,7 +269,7 @@ def condition(config):
269269

270270

271271
@patch("everest.bin.utils.export_data")
272-
@pytest.mark.fails_on_macos_github_workflow
272+
@pytest.mark.skip_mac_ci
273273
def test_everexport_entry_not_available_batches(mocked_func, caplog, cached_example):
274274
"""Test running everexport when config file contains non existing
275275
batch numbers in the list of user defined batches"""

tests/everest/functional/test_main_everest_entry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_everest_main_entry_bad_command():
4141

4242

4343
@pytest.mark.flaky(reruns=5)
44-
@pytest.mark.fails_on_macos_github_workflow
44+
@pytest.mark.skip_mac_ci
4545
@pytest.mark.integration_test
4646
def test_everest_entry_run(cached_example):
4747
_, config_file, _ = cached_example("math_func/config_minimal.yml")

tests/everest/test_detached.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
@pytest.mark.flaky(reruns=5)
4444
@pytest.mark.integration_test
45-
@pytest.mark.fails_on_macos_github_workflow
45+
@pytest.mark.skip_mac_ci
4646
@pytest.mark.xdist_group(name="starts_everest")
4747
async def test_https_requests(copy_math_func_test_data_to_tmp):
4848
everest_config = EverestConfig.load_file("config_minimal.yml")

tests/everest/test_everlint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def test_date_type(date, valid, min_config):
333333
EverestConfig(**min_config)
334334

335335

336-
@pytest.mark.fails_on_macos_github_workflow
336+
@pytest.mark.skip_mac_ci
337337
def test_lint_everest_models_jobs():
338338
pytest.importorskip("everest_models")
339339
config_file = relpath("../../test-data/everest/egg/everest/model/config.yml")

tests/everest/test_res_initialization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def test_summary_default(copy_egg_test_data_to_tmp):
241241
@hide_opm
242242
@skipif_no_everest_models
243243
@pytest.mark.everest_models_test
244-
@pytest.mark.fails_on_macos_github_workflow
244+
@pytest.mark.skip_mac_ci
245245
def test_summary_default_no_opm(copy_egg_test_data_to_tmp):
246246
config_dir = "everest/model"
247247
config_file = os.path.join(config_dir, "config.yml")

tests/everest/test_yaml_parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def test_valid_config_file(copy_test_data_to_tmp, monkeypatch):
106106
assert "could not find expected ':'" in parser.get_error()
107107

108108

109-
@pytest.mark.fails_on_macos_github_workflow
109+
@pytest.mark.skip_mac_ci
110110
@skipif_no_everest_models
111111
@pytest.mark.everest_models_test
112112
def test_valid_forward_model_config_files(copy_test_data_to_tmp, monkeypatch):
@@ -121,7 +121,7 @@ def test_valid_forward_model_config_files(copy_test_data_to_tmp, monkeypatch):
121121

122122
@skipif_no_everest_models
123123
@pytest.mark.everest_models_test
124-
@pytest.mark.fails_on_macos_github_workflow
124+
@pytest.mark.skip_mac_ci
125125
def test_invalid_forward_model_config_files(copy_test_data_to_tmp, monkeypatch):
126126
monkeypatch.chdir("valid_config_file/forward_models")
127127
parser = MockParser()

0 commit comments

Comments
 (0)