Fix dormant tests for capability negotiation
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 4s
CI/CD / test-frontend (pull_request) Has been skipped
CI/CD / test-runners (pull_request) Has been skipped
CI/CD / e2e-smoke (pull_request) Has been skipped
CI/CD / test-go-pg (pull_request) Successful in 2m42s
CI/CD / test-sqlite (pull_request) Successful in 3m2s
CI/CD / build-and-deploy (pull_request) Successful in 1m20s

Update TestBundledInstall_DormantPackage and
TestUpgrade_PackageDormantOnUnmetRequires to use the new
capabilities.required manifest field and expect packages to be
skipped (not registered) rather than marked dormant.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 08:59:11 +00:00
parent 44bf63e5fe
commit 301b7e0d02
2 changed files with 26 additions and 32 deletions

View File

@@ -438,7 +438,7 @@ func TestUpgrade_BundledSkipExistingOnRestart(t *testing.T) {
}
}
func TestUpgrade_PackageDormantOnUnmetRequires(t *testing.T) {
func TestUpgrade_PackageSkippedOnUnmetRequiredCaps(t *testing.T) {
stores := newTestStores(t)
ctx := context.Background()
@@ -447,25 +447,22 @@ func TestUpgrade_PackageDormantOnUnmetRequires(t *testing.T) {
// Package requires a capability that doesn't exist
buildTestPkg(t, bundledDir, map[string]any{
"id": "future-pkg",
"title": "Future",
"type": "extension",
"version": "1.0.0",
"hooks": []string{"on_install"},
"requires": []string{"kernel>=99.0.0"},
"id": "future-pkg",
"title": "Future",
"type": "extension",
"version": "1.0.0",
"hooks": []string{"on_install"},
"capabilities": map[string]any{
"required": []string{"pgvector"},
},
})
// No capabilities detected → pgvector is unavailable
InstallBundledPackages(bundledDir, packagesDir, "*", stores, nil, nil)
pkg, _ := stores.Packages.Get(ctx, "future-pkg")
if pkg == nil {
t.Fatal("package should still be registered")
}
if pkg.Status != "dormant" {
t.Errorf("status = %q, want %q", pkg.Status, "dormant")
}
if pkg.Enabled {
t.Error("dormant package should not be enabled")
if pkg != nil {
t.Error("package with unmet required capabilities should not be registered")
}
}