fix: isolate discovery tests from merged global config (isolate pytest from config.yaml) - #312
Conversation
|
Welcome to Skillware, @TrueFurina, and thanks for taking the time on this. We can’t merge #312 as it stands, as this work overlaps an issue that’s already claimed and in progress with another contributor, and we’ve asked folks (especially on first contributions) to comment on the issue and claim it before opening a PR. That keeps duplicate work and review churn down. A few other things that would help next time: please skim CONTRIBUTING.md and ai_native_workflow.md before you start, they cover complementary docs, tests, and ripple effects that are easy to miss otherwise. No hard feelings at all. If you’d like to stay involved, pick an unclaimed open issue, say you’re working on it in a comment, and we’ll go from there. Happy to suggest a few good first ones if that helps. <3 |
Summary
Fixes the two framework tests that fail with 458 pass / 2 fail after an operator runs
skillware mail signature init(which writes a user-levelconfig.yaml). Since #246, when global config exists, discovery uses the configured resolution order (project → external → bundled), which contradicts the legacy-mode assertions in:tests/test_discovery.py::test_get_skill_roots_order_env_project_bundledtests/test_loader.py::test_resolve_skill_prefers_env_over_cwdFix
Both tests now set
SKILLWARE_CONFIG_DIRto an empty temp directory viamonkeypatch, isolating the test run from any operator-level globalconfig.yaml. The legacy-order assertions then hold deterministically regardless of the developer's machine state. CI stays green on clean homes; local runs aftermail signature initare now green too.Changes
tests/test_discovery.py: addedmonkeypatch.setenv("SKILLWARE_CONFIG_DIR", ...)isolationtests/test_loader.py: same isolationAcceptance criteria
python -m pytest tests/test_discovery.py::test_get_skill_roots_order_env_project_bundled tests/test_loader.py::test_resolve_skill_prefers_env_over_cwd -qpasses even with a globalconfig.yamlpresent