Skip to content

test: skip ERA5 tests when CDS API is not configured#488

Merged
FabianHofmann merged 1 commit intomasterfrom
fix/ci-cutout-creation
Mar 13, 2026
Merged

test: skip ERA5 tests when CDS API is not configured#488
FabianHofmann merged 1 commit intomasterfrom
fix/ci-cutout-creation

Conversation

@FabianHofmann
Copy link
Contributor

@FabianHofmann FabianHofmann commented Mar 13, 2026

Changes proposed in this Pull Request

Fork PRs (e.g. #483) fail on macOS and Windows CI because:

  • The daily scheduled run only populates the cutout cache on Ubuntu. macOS/Windows rely on cross-OS cache restoration (enableCrossOsArchive: true), which seems to be flaky.
  • When the cache miss occurs, the test fixtures in conftest.py call cutout.prepare(), which tries to download ERA5 data from the CDS API.
  • GitHub Actions does not expose repository secrets to fork PRs for security, so CDSAPI_URL is empty, causing a MissingSchema error.

This PR introduces a _prepare_era5_cutout helper in test/conftest.py that checks whether the cached cutout file exists before calling cutout.prepare(). If the file is missing and CDSAPI_URL is not set, the test is skipped with a clear message instead of erroring out. This makes fork PR CI runs robust regardless of cache availability.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • Newly introduced dependencies are added to environment.yaml, environment_docs.yaml and setup.py (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

Fork PRs don't have access to repository secrets, so CDSAPI_URL
is empty. When no cached cutout exists and the CDS API is not
configured, skip the test instead of failing with MissingSchema.
@FabianHofmann FabianHofmann requested a review from lkstrp March 13, 2026 09:33
@FabianHofmann FabianHofmann enabled auto-merge (squash) March 13, 2026 10:35
@FabianHofmann FabianHofmann disabled auto-merge March 13, 2026 10:36
@FabianHofmann FabianHofmann merged commit eec268e into master Mar 13, 2026
19 checks passed
@FabianHofmann FabianHofmann deleted the fix/ci-cutout-creation branch March 13, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant