mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
fix(test): update registry.yaml path in integration tests
Tests now look for registry.yaml in source dir instead of config dir, matching the new registry location.
This commit is contained in:
@@ -53,7 +53,7 @@ func TestInstall_Global_FromConfig_DryRun_TrackedRespectsQuiet(t *testing.T) {
|
||||
targets: {}
|
||||
`)
|
||||
|
||||
registryPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
registryPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
if err := os.WriteFile(registryPath, []byte(`skills:
|
||||
- name: dryrun-track
|
||||
source: file://`+repoPath+`
|
||||
@@ -136,7 +136,7 @@ targets: {}
|
||||
result.AssertSuccess(t)
|
||||
|
||||
// Read registry.yaml (skills are stored here, not in config.yaml)
|
||||
registryPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
registryPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
data, err := os.ReadFile(registryPath)
|
||||
if err != nil {
|
||||
t.Fatalf("expected registry.yaml after install: %v", err)
|
||||
|
||||
@@ -34,7 +34,7 @@ targets: {}
|
||||
}
|
||||
|
||||
// Read registry and verify group field
|
||||
registryPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
registryPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
registryContent := sb.ReadFile(registryPath)
|
||||
if !strings.Contains(registryContent, "group: frontend") {
|
||||
t.Errorf("registry should contain 'group: frontend', got:\n%s", registryContent)
|
||||
@@ -65,7 +65,7 @@ targets: {}
|
||||
result.AssertSuccess(t)
|
||||
|
||||
// Read registry and verify group field
|
||||
registryPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
registryPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
registryContent := sb.ReadFile(registryPath)
|
||||
if !strings.Contains(registryContent, "group: frontend/vue") {
|
||||
t.Errorf("registry should contain 'group: frontend/vue', got:\n%s", registryContent)
|
||||
|
||||
@@ -434,7 +434,7 @@ skills:
|
||||
}
|
||||
|
||||
// Registry should no longer contain mygroup skills
|
||||
registryPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
registryPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
registryContent := sb.ReadFile(registryPath)
|
||||
if strings.Contains(registryContent, "skill-a") {
|
||||
t.Error("registry should not contain skill-a after group uninstall")
|
||||
@@ -503,7 +503,7 @@ skills:
|
||||
result := sb.RunCLI("uninstall", "security/", "-f")
|
||||
result.AssertSuccess(t)
|
||||
|
||||
registryPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
registryPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
registryContent := sb.ReadFile(registryPath)
|
||||
if strings.Contains(registryContent, "scan") {
|
||||
t.Error("registry should not contain scan after security/ uninstall")
|
||||
@@ -547,7 +547,7 @@ skills:
|
||||
}
|
||||
|
||||
// Registry skills should be cleared
|
||||
registryPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
registryPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
registryContent := sb.ReadFile(registryPath)
|
||||
if strings.Contains(registryContent, "alpha") || strings.Contains(registryContent, "beta") || strings.Contains(registryContent, "gamma") {
|
||||
t.Error("registry should not contain any skills after --all uninstall")
|
||||
|
||||
@@ -112,7 +112,7 @@ func TestUpdate_Prune_RegistryCleanup(t *testing.T) {
|
||||
result.AssertSuccess(t)
|
||||
|
||||
// Check registry does not contain the stale skill
|
||||
regPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
regPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
if _, err := os.Stat(regPath); err == nil {
|
||||
regContent := sb.ReadFile(regPath)
|
||||
if contains(regContent, staleName) {
|
||||
@@ -168,7 +168,7 @@ func TestUpdate_Prune_AllStale(t *testing.T) {
|
||||
}
|
||||
|
||||
// Registry should not contain either
|
||||
regPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
regPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
if _, err := os.Stat(regPath); err == nil {
|
||||
regContent := sb.ReadFile(regPath)
|
||||
for _, name := range []string{"alpha", "beta"} {
|
||||
@@ -277,7 +277,7 @@ func TestUpdate_Prune_NestedIntoSkill(t *testing.T) {
|
||||
}
|
||||
|
||||
// Registry should not contain stale-nested
|
||||
regPath := filepath.Join(filepath.Dir(sb.ConfigPath), "registry.yaml")
|
||||
regPath := filepath.Join(sb.SourcePath, "registry.yaml")
|
||||
if _, err := os.Stat(regPath); err == nil {
|
||||
regContent := sb.ReadFile(regPath)
|
||||
if contains(regContent, "stale-nested") {
|
||||
|
||||
Reference in New Issue
Block a user