Skip to content

Test That the Directory the Skills Installer Registers Outlives the Run - #2554

Merged
ptr727 merged 2 commits into
developfrom
feature/1756-registered-tree-outlives-run
Oct 8, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/1756-registered-tree-outlives-run

Conversation

@ptr727

@ptr727 ptr727 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

Each loader's kept-tree path now runs as one sequence under a test: fetch, swap, skills install, cleanup. The installer in the fixture is the real wrapper (install-skills.sh or install-skills.ps1) beside a stand-in scripts/skills_install.py that records the ROOT it would pass to claude plugin marketplace add. Each test asserts that the recorded directory is the kept skills-tree, that it still holds the installer once the cleanup has run, and that no staging or retired tree is left beside it.

This is the test #1756 named as its done condition: the registered directory outlives the run, on both platforms. The kept-tree design itself landed in #1773.

Verification

  • Windows, native: tests/test_bootstrap.py passes (68 passed, 32 skipped). The new PowerShell case runs the real bootstrap.ps1 functions under pwsh 7 on this host.
  • Linux: in python:3.12-slim as a non-root user, TestKeptTreeHandling passes (20 tests). TestPowerShellKeptTreeHandling passes too (25 tests, 5 skipped), run under pwsh 7 copied from the PowerShell image.
  • Mutation: swapping the installer ahead of the swap in each loader makes its test fail. The recorder then names skills-tree.new, the directory the cleanup removes. This was checked natively for bootstrap.ps1 and in the container for bootstrap.sh.
  • Live host: on this Windows host, the projecttemplate-fleet marketplace's folder source is the kept tree under %LOCALAPPDATA%\host-setup\skills-tree. It is still there after the bootstrap run that registered it, with no .new or .old beside it.
  • Checks: ruff check, ruff format, mypy, and the prose gate are clean. One local strict-review pass raised no findings.

Refs #1756

🤖 Generated with Claude Code

Each loader's kept-tree fetch, skills install, and cleanup now run in
sequence under a test whose installer records the ROOT it would register
as the Claude Code marketplace. The test asserts that directory is the
kept skills-tree and still exists once the cleanup has run. Running the
installer before the swap registers the staging tree, which the cleanup
removes, and fails both the bash and the PowerShell case.

Closes #1756

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 8, 2026 16:46
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2b6de829-ca17-42b2-ab3b-4b774b0dc96e
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Escape temporary paths before embedding them in PowerShell test scripts.

0 open findings

What changed in this PR

Adds cross-platform regression tests verifying the skills installer registers the durable skills-tree.

Changes:

  • Adds registration-recording fixtures and helpers.
  • Tests Linux and PowerShell lifecycle cleanup.
  • Verifies staging and retired trees are removed.
File Description
tests/​test_bootstrap.py Adds cross-platform kept-tree registration tests and harness support.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.40%. Comparing base (80b5f01) to head (8c97996).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2554   +/-   ##
========================================
  Coverage    58.40%   58.40%           
========================================
  Files           16       16           
  Lines         8090     8090           
========================================
  Hits          4725     4725           
  Misses        3365     3365           
Flag Coverage Δ
python-3.13 58.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The registration test quoted its fixture source and record paths into
single-quoted PowerShell strings, so a temporary directory under a user
name holding an apostrophe ended the string early and failed the case.
The harness now takes an environment for the run, and the test reads
both paths from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

Copilot's overview headline on aa8ce1b, "Escape temporary paths before embedding them in PowerShell test scripts" (which reported 0 open findings and opened no thread): real, fixed in 8c97996. The registration test quoted its fixture source and record paths into single-quoted PowerShell strings. With TMP set to a directory named o'brien, the previous version of the test fails and the fixed one passes, natively on Windows. The harness's run_loader now takes an environment, and the test reads both paths as $env:FIXTURE_SOURCE and $env:REGISTERED_RECORD. Sibling sweep: no other PowerShell body in the file quotes a filesystem path. The remaining single-quoted interpolations hold tree names, two literal -Dir values and tokens, and the menu harnesses take their paths as argv parameters. The bash sites put paths inside double quotes, and those classes are Linux-only and run under /tmp. A Windows path cannot contain a double quote either, so they are not the same defect.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues were identified.

0 open findings

🧠 Review effort: Lite

@ptr727
ptr727 merged commit 9cdf292 into develop Oct 8, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/1756-registered-tree-outlives-run branch October 8, 2026 16:59
ptr727 added a commit that referenced this pull request Oct 8, 2026
…Test Job (#2558)

## Summary

Promotes two changes from the `windows` lane.

- [#2554](#2554) adds a
test for each loader (`bootstrap.sh` and `bootstrap.ps1`). Each one runs
the kept-tree fetch, the swap, the skills install and the cleanup in
order, and asserts that the directory the installer registers as the
Claude Code marketplace is the kept `skills-tree` and still exists after
the run. It passes natively on Windows and on Linux, and running the
installer before the swap fails it.
- [#2555](#2555) adds a
hub-only `windows-test` job to `test-pull-request.yml`. It runs the
suite on `windows-latest` from Git Bash with uv installed, and
`check-workflow-status` now requires it. Its first green hosted run took
about 196s for 2277 tests. The required check's name is unchanged, and
no other repository's gate moves.

Closes #1756
Closes #1143

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants