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

Function newPostgresConfigStore

controlplane/admin/api_postgres_test.go:20–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18 "gorm.io/gorm"
19)
20
21func TestAdminAdmissionConfigMutationsSerializePostgres(t *testing.T) {
22 tests := []struct {
23 name string
24 orgID string
25 seed func(t *testing.T, store *configstore.ConfigStore)
26 mutation func(store *gormAPIStore) error
27 }{
28 {
29 name: "update org",
30 orgID: "admission-update-org",
31 seed: func(t *testing.T, store *configstore.ConfigStore) {
32 t.Helper()
33 if err := store.DB().Create(&configstore.Org{Name: "admission-update-org", DatabaseName: "admission_update_org"}).Error; err != nil {
34 t.Fatalf("create org: %v", err)
35 }
36 },
37 mutation: func(store *gormAPIStore) error {
38 _, found, err := store.UpdateOrg("admission-update-org", configstore.Org{MaxWorkers: 3, MaxVCPUs: 4})
39 if err == nil && !found {
40 return errors.New("updated org was not found")
41 }
42 return err
43 },
44 },
45 {
46 name: "delete org",
47 orgID: "admission-delete-org",
48 seed: func(t *testing.T, store *configstore.ConfigStore) {

Calls 5

DBMethod · 0.95
NewConfigStoreFunction · 0.92
startIntegrationPostgresFunction · 0.85
resetConfigStoreTablesFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected