fix(test): isolate CLI tests from user database and xfail RLIMIT_AS on macOS#611
Merged
lewisjared merged 2 commits intomainfrom Apr 5, 2026
Merged
Conversation
…n macOS The invoke_cli fixture now depends on the config fixture so every CLI test uses an isolated configuration directory and database instead of the user's real one. This prevents failures when the user's database has a different alembic revision than the codebase expects. Mark test_memory_limit_func as xfail on macOS where RLIMIT_AS is not supported by the kernel.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes test flakiness/failures stemming from (1) CLI tests unintentionally using a developer’s real local REF configuration/database, and (2) a memory-limit test that relies on RLIMIT_AS, which is unsupported on macOS.
Changes:
- Updated the
invoke_clipytest fixture to depend on theconfigfixture so CLI runs always use an isolated, per-test configuration directory/database. - Marked the
RLIMIT_AS-based memory limit test asxfailon Darwin/macOS. - Added a changelog entry describing both test fixes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/climate-ref/tests/unit/executor/test_hpc_executor.py | Marks test_memory_limit_func as xfail on macOS where RLIMIT_AS isn’t supported; minor cleanup of expected-bytes placement. |
| packages/climate-ref/src/climate_ref/conftest_plugin.py | Ensures invoke_cli triggers the isolated per-test config setup so CLI tests don’t touch user state. |
| changelog/611.fix.md | Documents the two test stability fixes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix 29 failing tests caused by two issues:
CLI test isolation: The
invoke_clifixture did not depend on theconfigfixture, so CLI tests hit the user's real database instead of an isolated temp one. If the user's database had a different alembic revision than the codebase (e.g. a removed migration), tests would fail withCan't locate revision. Fixed by makinginvoke_clidepend onconfig.macOS RLIMIT_AS:
test_memory_limit_funccallsresource.setrlimit(RLIMIT_AS)which is not supported on macOS. Marked asxfailon Darwin.Checklist
Please confirm that this pull request has done the following:
changelog/