test: smoke tests for update.py (Phase 2 incremental updater)#14
Open
bipinhcs11 wants to merge 1 commit into
Open
test: smoke tests for update.py (Phase 2 incremental updater)#14bipinhcs11 wants to merge 1 commit into
bipinhcs11 wants to merge 1 commit into
Conversation
update.py was the only module in tools/skill_generator/ with zero test coverage. This adds 35 tests across five test classes covering the four pure/filesystem helper functions and the ingest_responses() round-trip: - TestBumpVersion — all version extraction cases incl. missing field - TestResolveSkillsDir — .github/skills vs skills/ precedence + neither - TestDomainFromSkill — class/XML/SQL/shell extraction, dedup, empty - TestMapFilesToFeatures — matching, no-match, multi-feature, extensions - TestIngestResponses — missing/empty response, version bump, date forcing, schema validation gate, validate_schema=False bypass, feature filter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
$(cat <<'EOF'
What
Adds
tests/test_update.py— 35 stdlib-only smoke tests covering the entireupdate.pymodule, which was the only module intools/skill_generator/with zero test coverage.Why
update.pyis the Phase 2 incremental updater — the path that runs on every PR merge or manual refresh. It does git diff mapping, version bumping, and conditional git commits. A silent regression here would corrupt SKILL.md files without any test catching it.What's covered
TestBumpVersion_bump_version()TestResolveSkillsDir_resolve_skills_dir().github/skillsfound,skills/fallback, neither exists, both exist (.github/skillswins)TestDomainFromSkill_domain_from_skill()TestMapFilesToFeatures_map_files_to_features()TestIngestResponsesingest_responses()last_updatedforced to today, schema validation blocks invalid content,validate_schema=Falsebypass,--featurefilterNot in this PR (follow-up candidates)
emit_prompts()has no test — it callscrawl()and writes to disk; a meaningful smoke test needs a synthetic Java file tree. Worth a separate PR._git_changed_files()requires subprocess mocking; left out deliberately to keep this PR stdlib-only and focused.generate.pyJSON parse errors surface as raw tracebacks; a follow-up could wrap them with clearer messages.EOF
)
Generated by Claude Code