test: add hermetic coverage for scripts/sync-skills.sh (ADR-0026) - #123
Merged
Conversation
Stubs git clone and gh via PATH shims so the sync script's control flow runs against local fixture repos with no network access or real GH_TOKEN, and wires the new test/*.test.mjs file into npm run check's existing `npm test` step.
bketelsen
marked this pull request as ready for review
August 25, 2026 01:01
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 25, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 25, 2026
#124 changed scripts/lib/skills-sync-repo.sh to clone and push as `git -c credential.helper=<helper> <subcommand> ...`. The hermetic harness's fake git only recognised `clone` as $1, so the real github.com URL passed straight through to the real binary and CI's docs-gate failed both tests with an authentication error. - Locate the subcommand by skipping `-c <value>` pairs and flags (the same detection test/sync-skills-run-repo.test.mjs uses), and rewrite the frostyard clone URL by pattern rather than by argv position. - Accept the credential-helper prefix on the asserted push line. - Carry the sibling test's rsync fallback so the harness stays runnable in sandboxes without a system rsync. Co-Authored-By: Claude Fable 5 <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.
Summary
test/sync-skills.test.mjs, a hermetic test harness forscripts/sync-skills.shthat stubsgit cloneandghvia PATH shims so the script runs against local fixture repos with no network access and no realGH_TOKEN.npm run check(npm testalready globstest/*.test.mjs) — no other files changed.Coverage
git pushorghinvocation.chore/sync-core-skills, commits, pushes, callsgh pr listthengh pr createwith the expected repo/branch/title, and the pushed branch tip carries the synced skill content and marker.Test plan
node --test test/sync-skills.test.mjspasses (2/2).npm run checkpasses (28/28 tests across the repo) — verified locally with a minimal local-onlyrsyncshim, since this sandbox lacks a systemrsyncbinary; the pre-existingsync-skills-containment.test.mjshas the same sandbox-only dependency and is unaffected by this change. GitHub'subuntu-latestrunners (used by this repo'sdocs-gateCI job) shiprsyncby default.git pushstep — both times the new tests failed with the expected assertion, then the script was restored with no diff.Risk tier: 1 — adds test coverage only, no production code changed.
result.model: claude-sonnet-5