From 9a433723bdb7e4a259b6b1351652ec3012ed0653 Mon Sep 17 00:00:00 2001 From: Willie Date: Thu, 26 Mar 2026 22:50:03 +0800 Subject: [PATCH] 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. --- tests/integration/install_global_config_test.go | 4 ++-- tests/integration/install_group_test.go | 4 ++-- tests/integration/uninstall_test.go | 6 +++--- tests/integration/update_prune_test.go | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/integration/install_global_config_test.go b/tests/integration/install_global_config_test.go index 690bb9f70..ddac23a2f 100644 --- a/tests/integration/install_global_config_test.go +++ b/tests/integration/install_global_config_test.go @@ -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) diff --git a/tests/integration/install_group_test.go b/tests/integration/install_group_test.go index e9572c150..0adbebee6 100644 --- a/tests/integration/install_group_test.go +++ b/tests/integration/install_group_test.go @@ -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) diff --git a/tests/integration/uninstall_test.go b/tests/integration/uninstall_test.go index 246a383d7..8c0852e47 100644 --- a/tests/integration/uninstall_test.go +++ b/tests/integration/uninstall_test.go @@ -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") diff --git a/tests/integration/update_prune_test.go b/tests/integration/update_prune_test.go index 197ed1f33..cd1dbba42 100644 --- a/tests/integration/update_prune_test.go +++ b/tests/integration/update_prune_test.go @@ -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") {