test: smoke tests for update.py (was the only uncovered module)#17
Open
bipinhcs11 wants to merge 1 commit into
Open
test: smoke tests for update.py (was the only uncovered module)#17bipinhcs11 wants to merge 1 commit into
bipinhcs11 wants to merge 1 commit into
Conversation
update.py (the Phase-2 incremental updater) was the only module in
tools/skill_generator/ with no test file. Adds test_update.py covering
all seven pure/side-effectful helpers:
_bump_version — version parse and increment (5 cases)
_resolve_skills_dir — .github/skills vs skills vs neither vs both (4)
_domain_from_skill — class/xml/sql/sh extraction from SKILL.md (7)
_map_files_to_features — file→feature mapping, unknown, shared (5)
ingest_responses — version bump, last_updated, fence strip,
--feature filter, missing/empty response (8)
The two subprocess-backed functions (_git_changed_files, emit_prompts)
are not covered here — they require a real git repo and are exercised
in manual QA.
Test count: 172 existing → 202 total (30 new). All pass.
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.
What and why
update.py(the Phase-2 incremental updater) was the only module intools/skill_generator/with no test file. Every other module —crawler,generate,validate,doctor,plan,link— had smoke tests added in earlier PRs. This PR closes that gap.What's covered (30 new tests)
TestBumpVersion_bump_versionjava_version:TestResolveSkillsDir_resolve_skills_dir.github/skills/found,skills/found, neither returns None,.github/skills/preferred when both existTestDomainFromSkill_domain_from_skill.javaclasses extracted,.xml/.sql/.shrefs extracted, empty text no crash, description is""TestMapFilesToFeatures_map_files_to_features{}, file claimed by two features, empty changed-files listTestIngestResponsesHappyPathingest_responseslast_updatedset to today,failedlist emptyTestIngestResponsesNoSkillsDiringest_responsesTestIngestResponsesMissingResponseFileingest_responsesfailedentry, not a crashTestIngestResponsesEmptyResponseingest_responsesfailed, not writtenTestIngestResponsesMarkdownFenceStrippedingest_responsesTestIngestResponsesFeatureFilteringest_responses--featureflag restricts to one feature, leaves others untouchedThe two subprocess-backed functions (
_git_changed_filesandemit_prompts) are not covered here — they require a live git repo and are exercised in manual QA. That is noted as a follow-up.Test count
172 existing → 202 total. All pass (
python3 -m unittest discover -s tests).Follow-ups (not in this PR)
emit_promptsagainst a real temp git repo with staged changesingest_responses --commitpath (requires mockingsubprocess.run)Generated by Claude Code