From e582892b131d8a769d60bb4c196eca936d6772ca Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 18 May 2026 10:13:30 +0200 Subject: [PATCH 1/6] Rename file --- tests/validation/__init__.py | 0 tests/{uxvalidation.py => validation/test_ux.py} | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/validation/__init__.py rename tests/{uxvalidation.py => validation/test_ux.py} (100%) diff --git a/tests/validation/__init__.py b/tests/validation/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/uxvalidation.py b/tests/validation/test_ux.py similarity index 100% rename from tests/uxvalidation.py rename to tests/validation/test_ux.py From 8abea1e21334d41d751d8b65ecaaaf67e7503b04 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 18 May 2026 10:16:01 +0200 Subject: [PATCH 2/6] Skip validation and flaky tests by default Uses this SO trick for skipping marked tests by default https://stackoverflow.com/questions/66315234/exclude-some-tests-by-default/69185648#69185648 --- pixi.toml | 2 +- pyproject.toml | 1 + tests/conftest.py | 14 ++++++++++++++ tests/validation/test_ux.py | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index d2331b5761..e19c8b68f6 100644 --- a/pixi.toml +++ b/pixi.toml @@ -79,7 +79,7 @@ pytest-html = "*" pytest-cov = "*" [feature.test.tasks] -tests = { cmd = "pytest -m 'not flaky'", description = "Run the test suite." } +tests = { cmd = "pytest", description = "Run the test suite." } tests-notebooks = { cmd = "pytest --nbval-lax docs/user_guide/examples", description = "Run the user guide example notebooks as tests." } diff --git a/pyproject.toml b/pyproject.toml index d00ac65f5a..182a5d00f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,6 +60,7 @@ minversion = "7" markers = [ # can be skipped by doing `pytest -m "not slow"` etc. "flaky: flaky tests", "slow: slow tests", + "validation: validation tests (skipped by default, run with `-m validation`)", "v4alpha: failing tests that should work for v4alpha", "v4future: failing tests that should work for a future release of v4", "v4remove: failing tests that should probably be removed later", diff --git a/tests/conftest.py b/tests/conftest.py index 0fd949880f..ac29a34a5f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,19 @@ import pytest +SKIP_BY_DEFAULT = {"validation", "flaky"} + + +def pytest_collection_modifyitems(config, items): + if not config.getoption("-m"): + for item in items: + print(item.keywords) + skip_by_default = list(SKIP_BY_DEFAULT & set(item.keywords)) + if skip_by_default: + skip_marker = skip_by_default[0] # get first marker in case of multiple + item.add_marker( + pytest.mark.skip(reason=f"{skip_marker} tests skipped by default, use `-m {skip_marker}` to run") + ) + @pytest.fixture def tmp_parquet(tmp_path): diff --git a/tests/validation/test_ux.py b/tests/validation/test_ux.py index 9d160345f3..0658d88d41 100644 --- a/tests/validation/test_ux.py +++ b/tests/validation/test_ux.py @@ -36,6 +36,8 @@ AdvectionRK4_3D, ) +pytestmark = pytest.mark.validation + # Uniform translation parameters T1_1_U0 = 0.001 T1_1_V0 = 0.0005 From 0ff9fe14b64b4db34e0d5784f2d644a77a7c9a39 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 18 May 2026 11:44:14 +0200 Subject: [PATCH 3/6] Add pixi tasks --- .github/workflows/ci.yml | 4 ++-- pixi.toml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de34d104a6..d51af81c6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,7 +127,7 @@ jobs: name: Unittest report ${{ matrix.os }}-${{ matrix.pixi-environment }} path: ${{ env.COVERAGE_REPORT }} flaky-unit-test: - name: "Flaky unit tests: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests -m 'flaky'" + name: "Flaky unit tests: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests-flaky" runs-on: ${{ matrix.os }}-latest needs: [cache-pixi-lock] permissions: @@ -165,7 +165,7 @@ jobs: - name: Unit test id: unit-test run: | - pixi run -e ${{ matrix.pixi-environment }} tests -m 'flaky' -v -s --cov=parcels --cov-report=xml --html="${COVERAGE_REPORT}" --self-contained-html + pixi run -e ${{ matrix.pixi-environment }} tests-flaky -v -s --cov=parcels --cov-report=xml --html="${COVERAGE_REPORT}" --self-contained-html # explicitly save the cache so it gets updated, also do this even if it fails. - name: Save cached hypothesis directory id: save-hypothesis-cache diff --git a/pixi.toml b/pixi.toml index e19c8b68f6..6568b39b7a 100644 --- a/pixi.toml +++ b/pixi.toml @@ -80,6 +80,8 @@ pytest-cov = "*" [feature.test.tasks] tests = { cmd = "pytest", description = "Run the test suite." } +tests-flaky = { cmd = "pytest -m 'flaky'", description = "Run flaky tests." } +tests-validation = { cmd = "pytest -m 'flaky'", description = "Run validation tests." } tests-notebooks = { cmd = "pytest --nbval-lax docs/user_guide/examples", description = "Run the user guide example notebooks as tests." } From 68148fe5edad780e7b20bcd989fc440237f0f83b Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 18 May 2026 11:47:45 +0200 Subject: [PATCH 4/6] Fix validation tests --- pixi.toml | 2 +- tests/validation/test_ux.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pixi.toml b/pixi.toml index 6568b39b7a..a138098f73 100644 --- a/pixi.toml +++ b/pixi.toml @@ -81,7 +81,7 @@ pytest-cov = "*" [feature.test.tasks] tests = { cmd = "pytest", description = "Run the test suite." } tests-flaky = { cmd = "pytest -m 'flaky'", description = "Run flaky tests." } -tests-validation = { cmd = "pytest -m 'flaky'", description = "Run validation tests." } +tests-validation = { cmd = "pytest -m 'validation'", description = "Run validation tests." } tests-notebooks = { cmd = "pytest --nbval-lax docs/user_guide/examples", description = "Run the user guide example notebooks as tests." } diff --git a/tests/validation/test_ux.py b/tests/validation/test_ux.py index 0658d88d41..7771366f6b 100644 --- a/tests/validation/test_ux.py +++ b/tests/validation/test_ux.py @@ -69,7 +69,7 @@ ) @pytest.mark.parametrize("integrator", [AdvectionEE, AdvectionRK4], ids=["EE", "RK4"]) def test_uniform_translation_exact(dataset_fn, integrator): - ds = dataset_fn(nx=20, U0=T1_1_U0, V0=T1_1_V0) + ds = dataset_fn(nx=20, u0=T1_1_U0, v0=T1_1_V0) fieldset = parcels.FieldSet.from_ugrid_conventions(ds, mesh="flat") pset = parcels.ParticleSet(fieldset, lon=[T1_1_LON0], lat=[T1_1_LAT0]) From 78fbae572187e487b79492a78a16ed5f5a219875 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 18 May 2026 12:55:07 +0200 Subject: [PATCH 5/6] Update marker description --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 182a5d00f3..a8e0b16642 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,9 +58,9 @@ testpaths = ["tests"] python_files = ["test_*.py", "example_*.py", "*tutorial*"] minversion = "7" markers = [ # can be skipped by doing `pytest -m "not slow"` etc. - "flaky: flaky tests", "slow: slow tests", "validation: validation tests (skipped by default, run with `-m validation`)", + "flaky: flaky tests (skipped by default, run with `-m flaky`)", "v4alpha: failing tests that should work for v4alpha", "v4future: failing tests that should work for a future release of v4", "v4remove: failing tests that should probably be removed later", From 8e92fe718ce103e6f966bd1d8afe7468d3163da0 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Mon, 18 May 2026 12:57:15 +0200 Subject: [PATCH 6/6] Update release checklist --- docs/development/maintainer.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/development/maintainer.md b/docs/development/maintainer.md index d284493a5b..c357dca700 100644 --- a/docs/development/maintainer.md +++ b/docs/development/maintainer.md @@ -19,6 +19,7 @@ ## Release checklist +- Run the validation test suite (`pixi run tests-validation`) - Go to GitHub, draft new release. Enter name of version and "create new tag" if it doesn't already exist. Click "Generate Release Notes". Currate release notes as needed. Look at a previous version release to match the format (title, header, section organisation etc.) - Go to [conda-forge/parcels-feedstock](https://github.com/conda-forge/parcels-feedstock), create a new issue (select the "Bot Commands" issue from the menu) with title `@conda-forge-admin, please update version`. This will prompt a build, otherwise there can be a delay in the build. - Approve PR and merge on green