MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestKindConfigStoreSeedSQL

Function TestKindConfigStoreSeedSQL

tests/configstore/seed_sql_test.go:54–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestKindConfigStoreSeedSQL(t *testing.T) {
55 store := newIsolatedConfigStore(t)
56
57 if err := applyConfigStoreSeed(t, store, filepath.Join(findProjectRoot(t), "k8s", "kind", "config-store.seed.sql")); err != nil {
58 t.Fatalf("apply kind seed: %v", err)
59 }
60
61 if err := store.Reload(); err != nil {
62 t.Fatalf("reload store: %v", err)
63 }
64
65 snap := store.Snapshot()
66 orgCfg := snap.Orgs["local"]
67 if orgCfg == nil {
68 t.Fatal("expected local org from kind seed")
69 return
70 }
71 if orgCfg.Warehouse == nil {
72 t.Fatal("expected local warehouse from kind seed")
73 }
74 if got := orgCfg.Warehouse.MetadataStore.Endpoint; got != "duckgres-local-ducklake-metadata" {
75 t.Fatalf("expected kind metadata endpoint, got %q", got)
76 }
77 if got := orgCfg.Warehouse.MetadataStore.Port; got != 5432 {
78 t.Fatalf("expected kind metadata port 5432, got %d", got)
79 }
80 if got := orgCfg.Warehouse.S3.Endpoint; got != "duckgres-local-minio:9000" {
81 t.Fatalf("expected kind s3 endpoint, got %q", got)
82 }
83 if got := orgCfg.Warehouse.S3.Bucket; got != "duckgres-local" {
84 t.Fatalf("expected duckgres-local bucket, got %q", got)
85 }
86 if got := orgCfg.Warehouse.MetadataStoreCredentials.Name; got != "local-metadata" {
87 t.Fatalf("expected kind metadata secret ref, got %q", got)
88 }
89 if got := orgCfg.Warehouse.S3Credentials.Name; got != "local-s3" {
90 t.Fatalf("expected kind s3 secret ref, got %q", got)
91 }
92}
93
94func TestTenantIsolationConfigStoreSeedSQL(t *testing.T) {
95 seedPath := filepath.Join(findProjectRoot(t), "tests", "configstore", "testdata", "tenant-isolation.seed.sql")

Callers

nothing calls this directly

Calls 5

newIsolatedConfigStoreFunction · 0.85
applyConfigStoreSeedFunction · 0.85
ReloadMethod · 0.80
SnapshotMethod · 0.80
findProjectRootFunction · 0.70

Tested by

no test coverage detected