Skip to content

tests(skill-evals): add test suite for runner.py#234

Merged
potiuk merged 3 commits into
apache:mainfrom
justinmclean:analyze-test-coverage
May 20, 2026
Merged

tests(skill-evals): add test suite for runner.py#234
potiuk merged 3 commits into
apache:mainfrom
justinmclean:analyze-test-coverage

Conversation

@justinmclean
Copy link
Copy Markdown
Member

tests(skill-evals): add test suite for runner.py

runner.py in tools/skill-evals previously had zero test coverage. This PR adds 37 tests covering all public functions, and makes a small refactor to main() to make it cleanly testable.

Changes

tests/test_runner.py — new test suite covering:

  • build_corpus_text / build_roster_text — empty and multi-item cases
  • find_repo_root — child dir, root itself, missing .git
  • extract_skill_section — heading levels, code fences, missing heading
  • load_step_configstep-config.json path, system-prompt.md fallback, output-spec appending, custom user-prompt-template, missing both
  • load_case — optional corpus/roster, required report/expected
  • find_cases — single case, fixtures dir, recursive skill dir, nested-fixtures deduplication
  • main CLI — no cases → exit 1, --quiet flag, prompt printing, caching, bad template raises

runner.pymain() now accepts an optional argv parameter (consistent with sandbox-lint and skill-validator) so tests can invoke it directly without patching sys.argv. CLI output capture in tests uses pytest's capsys fixture rather than monkeypatching sys.stdout.

claude added 3 commits May 19, 2026 08:58
37 tests covering all public functions in runner.py, which previously
had zero test coverage:

- build_corpus_text / build_roster_text (empty and multi-item cases)
- find_repo_root (child dir, root itself, missing .git)
- extract_skill_section (heading levels, code fences, missing heading)
- load_step_config (step-config.json path, system-prompt.md fallback,
  output-spec appending, custom user-prompt-template, missing both)
- load_case (optional corpus/roster, required report/expected)
- find_cases (single case, fixtures dir, recursive skill dir,
  nested-fixtures deduplication)
- main CLI (no cases → exit 1, --quiet flag, prompt printing, caching,
  bad template raises)

https://claude.ai/code/session_01WEx58ofmTyCe2YhCppV3qN
Give main() an optional argv parameter (consistent with sandbox-lint
and skill-validator) so tests can call it directly without patching
sys.argv. Switch CLI test output capture to pytest's capsys fixture,
removing the monkeypatch-on-sys.stdout approach entirely.

https://claude.ai/code/session_01WEx58ofmTyCe2YhCppV3qN
@justinmclean justinmclean self-assigned this May 20, 2026
@potiuk potiuk merged commit c713e0c into apache:main May 20, 2026
13 checks passed
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.

3 participants