test: smoke tests for update.py pure functions (Phase 2 updater)#19
Open
bipinhcs11 wants to merge 1 commit into
Open
test: smoke tests for update.py pure functions (Phase 2 updater)#19bipinhcs11 wants to merge 1 commit into
bipinhcs11 wants to merge 1 commit into
Conversation
update.py (Phase 2 incremental updater) had zero test coverage despite
being the critical path for keeping skills current after each code
change. Adds tests/test_update.py covering:
- _bump_version: normal bump, no-space colon, indented field fallback,
missing field fallback, large version, multiple fields (first wins)
- _domain_from_skill: class/XML/SQL/shell extraction, lowercase guard,
id/name assignment, empty-input safety
- _map_files_to_features: exact match, no-match, file shared by two
features (mapped to both), empty changed-files list, non-existent
skills directory
- ingest_responses (commit=False): correct version bump, force-bump
when AI forgets to increment, last_updated forced to today, fenced
response unwrapped, empty response → failed, missing response →
failed, missing SKILL.md → failed, no skills dir → early return
31 new tests; full suite: 203 passed, 0 failed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
https://claude.ai/code/session_01Ky9BS6ZwmrR437WUcEXvD6
This was referenced May 31, 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.
Summary
update.py— the Phase 2 incremental updater — had zero test coverage despite being the critical path for keeping skills current after every code change. This PR addstests/test_update.pywith 31 stdlib-only smoke tests covering all pure functions.Functions covered:
_bump_version_domain_from_skill_map_files_to_featuresingest_responses(commit=False)last_updatedforced to today, fenced response unwrapped, empty response → failed, missing response file → failed, missing SKILL.md → failed, no skills dir → early returnKey regression pinned by these tests: when the AI response omits a version bump (returns
version: 3when the existing file was alreadyversion: 3),ingest_responsesmust still writeversion: 4. There.subin the ingest path handles this correctly and the test now guards against accidental removal.Test plan
Follow-ups (not in this PR)
cli.pyalso has no direct tests; integration-level tests forbuild_parser()and the_cmd_*dispatch functions would catch argument wiring bugs._git_changed_filesis not tested here because it callssubprocessdirectly; mocking subprocess is out of scope for stdlib-only smoke tests.https://claude.ai/code/session_01Ky9BS6ZwmrR437WUcEXvD6
Generated by Claude Code