tests(skill-evals): add test suite for runner.py#234
Merged
Conversation
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
potiuk
approved these changes
May 20, 2026
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.
tests(skill-evals): add test suite for runner.py
runner.pyintools/skill-evalspreviously had zero test coverage. This PR adds 37 tests covering all public functions, and makes a small refactor tomain()to make it cleanly testable.Changes
tests/test_runner.py— new test suite covering:build_corpus_text/build_roster_text— empty and multi-item casesfind_repo_root— child dir, root itself, missing.gitextract_skill_section— heading levels, code fences, missing headingload_step_config—step-config.jsonpath,system-prompt.mdfallback, output-spec appending, custom user-prompt-template, missing bothload_case— optional corpus/roster, required report/expectedfind_cases— single case, fixtures dir, recursive skill dir, nested-fixtures deduplicationmainCLI — no cases → exit 1,--quietflag, prompt printing, caching, bad template raisesrunner.py—main()now accepts an optionalargvparameter (consistent withsandbox-lintandskill-validator) so tests can invoke it directly without patchingsys.argv. CLI output capture in tests uses pytest'scapsysfixture rather than monkeypatchingsys.stdout.