Skip to content

[Bug]: Discovery tests fail when global config.yaml exists — isolate pytest from merged config #302

Description

@rosspeili

Affected Component

Tests / CI

Skill ID (if applicable)

No response

Bug Description

Two framework tests assume legacy skill-root order (SKILLWARE_SKILL_PATH → cwd ./skills/ → bundled):

  • tests/test_discovery.py::test_get_skill_roots_order_env_project_bundled
  • tests/test_loader.py::test_resolve_skill_prefers_env_over_cwd

Since #246, when global or project YAML config exists, discovery uses configured mode with default paths.resolution.order: project → external → bundled.

After operator setup (e.g. skillware mail signature init from #292), a user-level config.yaml exists. Local pytest tests/ then uses configured mode and those two tests fail (458 pass, 2 fail). CI stays green on a clean home directory.

Not caused by #292/#293 skill code — test isolation + assertions that only match legacy mode.

Why it matters

  • Developers get false “2 failed” after normal mail/config init.
  • Shadowing policy: configured mode lets project ./skills/ override SKILLWARE_SKILL_PATH; tests should lock both legacy and configured behavior.
  • Versioning: test/docs fix only; no runtime semver change unless we deliberately change [Feat]: CLI config and three-tier skill path resolution (global + project) #246 order (out of scope).

Steps to Reproduce

  1. Clone repo; pip install -e ".[dev,all]".

  2. Run skillware mail signature init (writes global config.yaml).

  3. From repo root:

    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 -q

  4. Failures: project tier listed/resolved before external/env.

Control (should pass): set SKILLWARE_CONFIG_DIR to an empty temp directory, then run the same two tests.

Error Logs

AssertionError: assert <SkillRootTier.PROJECT: 'project'> == <SkillRootTier.EXTERNAL: 'external'>
  tests/test_discovery.py:46

AssertionError: assert 'from_cwd' == 'from_env'
  tests/test_loader.py:398

Environment

Windows 11 · Python 3.13 · editable clone · global config.yaml after skillware mail signature init · full suite otherwise 458/460 pass

Metadata

Metadata

Assignees

Labels

bugSomething isn't working.ciGitHub Actions workflows and CI configuration.core frameworkChanges to loader, env, config merge (skillware/core/config.py), base classes, or model adapters.good first issueGood for newcomers.help wantedExtra attention is needed.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions