library tests: TestAgentsSkillsFolders gives Alma a data folder on Windows (#973) — sandbox clears APPDATA, so os.UserConfigDir failed there: Alma (whose data folder is %APPDATA%\alma) was never there, and the test's MkdirAll made an "alma" folder in the working directory. The test now sets APPDATA in its sandbox, and puts Goose's config where Goose reads it on Windows (%APPDATA%\Block\goose\config), as Alma reads the shared folder Goose's skills are in. No app change. Passes on the Windows box with and without the symlink privilege, and on the Mac.

This commit is contained in:
yetone
2026-10-06 13:32:03 +08:00
parent ce9fc6758a
commit 64a0e6c393
+11 -2
View File
@@ -42,8 +42,17 @@ func TestAgentsSkillsFolders(t *testing.T) {
t.Errorf("kimi with ~/.config/agents/skills: %+v", tg)
}
// Alma, there once it has its data folder, reads ~/.config/alma/skills
// on every system, and Claude Code's, Codex's and the shared ones (#824)
cfg, _ := os.UserConfigDir()
// on every system, and Claude Code's, Codex's and the shared ones (#824).
// Its data folder on Windows is under %APPDATA%, which sandbox clears:
// without one there is no Alma there. Goose's config moves there with
// it, so Goose is there too
app := filepath.Join(h, "AppData", "Roaming")
t.Setenv("APPDATA", app)
write(t, filepath.Join(app, "Block", "goose", "config", "config.yaml"), "")
cfg, err := os.UserConfigDir()
if err != nil {
t.Fatal(err)
}
os.MkdirAll(filepath.Join(cfg, "alma"), 0o755)
if tg := targetByID("alma"); tg == nil || tg.Skills != filepath.Join(h, ".config/alma/skills") ||
!slices.Contains(tg.SkillsAlso, "claude") || !slices.Contains(tg.SkillsAlso, "codex") || !slices.Contains(tg.SkillsAlso, "goose") {