Feat v0.6.18 ci bundled packages (#53)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m45s
CI/CD / test-sqlite (push) Successful in 2m58s
CI/CD / build-and-deploy (push) Successful in 1m37s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #53.
This commit is contained in:
2026-04-01 16:49:01 +00:00
committed by xcaliber
parent e7d1b53ebf
commit 1236220302
5 changed files with 30 additions and 11 deletions

View File

@@ -441,7 +441,8 @@ func TestExportPackage_NotFound(t *testing.T) {
}
}
// TestBundledInstall_DefaultAllowlist verifies the curated default set behavior.
// TestBundledInstall_DefaultAllowlist verifies that an empty allowlist
// installs nothing (defaultBundledPackages is empty since v0.6.17).
func TestBundledInstall_DefaultAllowlist(t *testing.T) {
stores := newTestStores(t)
ctx := context.Background()
@@ -449,7 +450,7 @@ func TestBundledInstall_DefaultAllowlist(t *testing.T) {
bundledDir := t.TempDir()
packagesDir := t.TempDir()
// Create packages: one in default set, one not
// Create packages — neither should be installed with empty defaults
buildTestPkg(t, bundledDir, map[string]any{
"id": "notes", "title": "Notes", "type": "surface", "version": "1.0.0",
})
@@ -457,19 +458,17 @@ func TestBundledInstall_DefaultAllowlist(t *testing.T) {
"id": "regex-tester", "title": "Regex Tester", "type": "extension", "version": "1.0.0",
})
// Empty allowlist → curated defaults
// Empty allowlist → empty default set → nothing installed
InstallBundledPackages(bundledDir, packagesDir, "", stores, nil)
// "notes" is in the default set → should be installed
pkg, err := stores.Packages.Get(ctx, "notes")
if err != nil || pkg == nil {
t.Fatal("notes should be installed (in default set)")
pkg, _ := stores.Packages.Get(ctx, "notes")
if pkg != nil {
t.Fatal("notes should NOT be installed (default set is empty)")
}
// "regex-tester" is NOT in the default set → should be filtered
pkg, _ = stores.Packages.Get(ctx, "regex-tester")
if pkg != nil {
t.Fatal("regex-tester should NOT be installed (not in default set)")
t.Fatal("regex-tester should NOT be installed (default set is empty)")
}
}