Skip to content

Commit e58a9b9

Browse files
fix: stop tests leaking skill dirs into cmd/, drop the gitignore band-aid (#45)
Two cmd/* tests installed skills into harnesses with no SkillDir, so the install path resolved relative to the test CWD and littered the repo with `cmd/praxis*/` skill dirs. The leak was masked by a `/cmd/praxis*/` .gitignore rule rather than fixed. - TestInstallSkill_Success: didn't isolate HOME or stub the catalog fetch, so after the (seamed) meta-skill install the real catalog flow ran against the developer's live profile and installed real catalog skills into the SkillDir-less harnesses. Isolate HOME + clear PRAXIS_PROFILE so the catalog step soft-skips (matches sibling tests). - TestRunPostAuthSetupAgentFetchFailureLeavesExistingInPlace: set AgentDir but no SkillDir, so runPostAuthSetup's meta-skill install (praxis, praxis-memory, praxis-onboarding) landed in CWD. Point SkillDir under the test's tmp HOME. - .gitignore: drop the now-obsolete /cmd/praxis/ and /cmd/praxis-*/ rules (and the explanatory comment) — with the leaks fixed, a future leak will correctly surface in `git status` instead of being silently hidden. Verified: `go test -race ./...` is green and leaves no cmd/praxis* dirs. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8b86db2 commit e58a9b9

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
*.exe
88
coverage.txt
99

10-
# Pre-existing test leak: some cmd/* test writes catalog skill files
11-
# relative to its CWD instead of to t.TempDir(), polluting the repo
12-
# tree with /cmd/praxis*/ folders containing real-looking SKILL.md
13-
# contents. Until that test is fixed, ignore the leak so it doesn't
14-
# litter `git status` on every test run.
15-
/cmd/praxis/
16-
/cmd/praxis-*/
17-
1810
# goreleaser output
1911
/dist/
2012

cmd/login_setup_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ func TestRunPostAuthSetupAgentFetchFailureLeavesExistingInPlace(t *testing.T) {
296296
hosts := []harness.Harness{{
297297
Name: "claude-code",
298298
Detected: true,
299+
// SkillDir must point under tmp: runPostAuthSetup installs the
300+
// meta-skills before the agent step, and a host without a SkillDir
301+
// resolves to a CWD-relative path, leaking praxis* skill dirs into cmd/.
302+
SkillDir: filepath.Join(tmp, "claude", "skills"),
299303
AgentDir: filepath.Join(tmp, "claude", "agents"),
300304
}}
301305

cmd/skill_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ func TestInstallSkill_NoHosts(t *testing.T) {
9090
}
9191

9292
func TestInstallSkill_Success(t *testing.T) {
93+
// Isolate HOME so the catalog step resolves a not-logged-in profile and
94+
// soft-skips. Without this, the real catalog flow runs against the
95+
// developer's live profile and installs real catalog skills into the
96+
// SkillDir-less harnesses below — which resolves to a path under the test
97+
// CWD, leaking praxis-* skill dirs into cmd/ (see .gitignore history).
98+
t.Setenv("HOME", t.TempDir())
99+
t.Setenv("PRAXIS_PROFILE", "")
93100
withSeams(t,
94101
func() []harness.Harness {
95102
return []harness.Harness{

0 commit comments

Comments
 (0)