mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 12:23:22 +00:00
Project targets now use the same short names as global targets (e.g., "claude" instead of "claude-code"). Old project_name values are preserved as aliases so existing configs continue to work. - Add Aliases field to targetSpec (deprecated, remove once safe) - Update 11 targets in targets.yaml: project_name = global_name - LookupProjectTarget falls back to alias lookup - Fix 3 callers that bypassed LookupProjectTarget - Extend MatchesTargetName and KnownTargetNames with alias support - Add TestLookupProjectTarget_Alias - Update all integration tests, docs, CLI help, and FAQ
69 lines
1.9 KiB
Go
69 lines
1.9 KiB
Go
//go:build !online
|
|
|
|
package integration
|
|
|
|
import (
|
|
"encoding/json"
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"skillshare/internal/testutil"
|
|
)
|
|
|
|
func TestUpdateProject_LocalSkill_Error(t *testing.T) {
|
|
sb := testutil.NewSandbox(t)
|
|
defer sb.Cleanup()
|
|
projectRoot := sb.SetupProjectDir("claude")
|
|
sb.CreateProjectSkill(projectRoot, "local", map[string]string{
|
|
"SKILL.md": "# Local",
|
|
})
|
|
|
|
result := sb.RunCLIInDir(projectRoot, "update", "local", "-p")
|
|
result.AssertFailure(t)
|
|
result.AssertAnyOutputContains(t, "local skill")
|
|
}
|
|
|
|
func TestUpdateProject_NotFound_Error(t *testing.T) {
|
|
sb := testutil.NewSandbox(t)
|
|
defer sb.Cleanup()
|
|
projectRoot := sb.SetupProjectDir("claude")
|
|
|
|
result := sb.RunCLIInDir(projectRoot, "update", "ghost", "-p")
|
|
result.AssertFailure(t)
|
|
result.AssertAnyOutputContains(t, "not found")
|
|
}
|
|
|
|
func TestUpdateProject_DryRun(t *testing.T) {
|
|
sb := testutil.NewSandbox(t)
|
|
defer sb.Cleanup()
|
|
projectRoot := sb.SetupProjectDir("claude")
|
|
|
|
skillDir := sb.CreateProjectSkill(projectRoot, "remote", map[string]string{
|
|
"SKILL.md": "# Remote",
|
|
})
|
|
meta := map[string]interface{}{"source": "/tmp/fake-source", "type": "local"}
|
|
metaJSON, _ := json.Marshal(meta)
|
|
os.WriteFile(filepath.Join(skillDir, ".skillshare-meta.json"), metaJSON, 0644)
|
|
|
|
result := sb.RunCLIInDir(projectRoot, "update", "remote", "--dry-run", "-p")
|
|
result.AssertSuccess(t)
|
|
result.AssertAnyOutputContains(t, "dry-run")
|
|
}
|
|
|
|
func TestUpdateProject_AllDryRun_SkipsLocal(t *testing.T) {
|
|
sb := testutil.NewSandbox(t)
|
|
defer sb.Cleanup()
|
|
projectRoot := sb.SetupProjectDir("claude")
|
|
|
|
// Local (no meta) - should be skipped
|
|
sb.CreateProjectSkill(projectRoot, "local-only", map[string]string{
|
|
"SKILL.md": "# Local Only",
|
|
})
|
|
|
|
result := sb.RunCLIInDir(projectRoot, "update", "--all", "--dry-run", "-p")
|
|
result.AssertSuccess(t)
|
|
// Should not contain "local-only" in dry-run output since it has no meta
|
|
result.AssertOutputNotContains(t, "local-only")
|
|
}
|