Add multiplatform testing builds#438
Conversation
Pull Request Test Coverage Report for Build 15886172993Details
💛 - Coveralls |
|
@cehbrecht Consider this PR a WIP; I need to get access to a Windows computer to see what's up, but essentially, there should be a simple way to load UNIX-style file paths on Windows and still have everything work as intended. |
for more information, see https://pre-commit.ci
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the project’s CI pipeline toward multi-platform coverage (macOS + Windows alongside Linux) and updates the test harness/data-fetching utilities to better support running the test suite across different OS environments.
Changes:
- Expand GitHub Actions test matrices to include macOS and Windows (PyPI/tox) and macOS (conda/micromamba), with per-OS caching.
- Rework test-data gathering in
tests/conftest.pyandclisops/utils/testing.py(data registry handling, cache dir plumbing, worker coordination). - Update many tests and dataset-opening helpers to use
xarray.open_mfdataset(..., data_vars="all", ...)to stabilize multi-file dataset behavior.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/main.yml |
Adds OS matrices and per-OS caching for tox/conda jobs. |
clisops/__version__.py |
Updates copyright year. |
clisops/project_utils.py |
Adjusts path handling for deducing projects, base dirs, ds-id mapping, and URL-to-path mapping. |
clisops/utils/dataset_utils.py |
Improves typing and opener kwargs; changes empty-input exception type. |
clisops/utils/testing.py |
Refactors test-data cache defaults/env handling, registry fetching, and adds custom Pooch downloader headers. |
tests/conftest.py |
Reworks session-level test-data gathering/copying and removes older base fixtures. |
tests/test_core_regrid.py |
Removes an unused fixture parameter. |
tests/test_core_subset.py |
Tweaks open_mfdataset options for multi-file datasets. |
tests/test_dataset_utils.py |
Adds data_vars="all" to multiple open_mfdataset calls. |
tests/test_file_namers.py |
Adds data_vars="all" to open_mfdataset calls used in naming tests. |
tests/test_ops_average.py |
Adds data_vars="all" and re-enables aux-variable test using portable paths. |
tests/test_ops_subset.py |
Makes dataset loader more explicit about decoding and uses portable file paths. |
tests/test_ops_xarray_mean.py |
Adds data_vars="all" when opening multi-file datasets. |
tests/test_output_utils.py |
Adds data_vars="all" for multi-file open in test helper. |
tests/test_project_utils.py |
Adjusts some project/path tests for portability and xarray opening behavior. |
Comments suppressed due to low confidence (1)
.github/workflows/main.yml:201
- This step is labeled macOS but is conditioned on
ubuntu-latest, and it caches Linux paths (~/.cache/...) instead of the macOS~/Library/Caches/...paths used elsewhere in this workflow. This makes macOS caching ineffective.
if: matrix.os == 'ubuntu-latest'
with:
path: |
~/.cache/mini-esgf-data
~/.cache/xclim-testdata
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if self._base_dir: | ||
| self._ds_id = ".".join(self._data_path.replace(self._base_dir, self._project).strip("/").split("/")) | ||
| relative_path = os.path.relpath(self._data_path, self._base_dir) | ||
| self._ds_id = ".".join(relative_path.split(os.sep)) |
There was a problem hiding this comment.
@copilot Can you propose a fix here?
| cmip5_base_dir = Path(project_utils.get_project_base_dir("cmip5")) | ||
| assert Path("/mnt/lustre/work/kd0956/CMIP5/data/cmip5").match(str(cmip5_base_dir)) | ||
|
|
||
| c3s_cordex_base_dir = project_utils.get_project_base_dir("c3s-cordex") | ||
| assert c3s_cordex_base_dir == "/mnt/lustre/work/ik1017/C3SCORDEX/data/c3s-cordex" | ||
| c3s_cordex_base_dir = Path(project_utils.get_project_base_dir("c3s-cordex")) | ||
| assert Path("/mnt/lustre/work/ik1017/C3SCORDEX/data/c3s-cordex").match(str(c3s_cordex_base_dir)) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
|
I've gone as far as I can without a Windows VM. Will try getting one soon to finish this. |
Pull Request Checklist:
What kind of change does this PR introduce?:
Does this PR introduce a breaking change?:
No.
Other information:
The testing data is fetched currently from two different repositories.
unix-style file locking is used when gathering these files, which isn't available on Windows. Additionally,xesmfis not available on Windows either (conda).Will try seeing if
toxbuilds could potentially work on Windows, otherwise I'll adjust the metadata to suggest thatclisopsdoesn't support Windows.