(t *testing.T)
| 18 | "gorm.io/gorm" |
| 19 | ) |
| 20 | |
| 21 | func 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) { |
no test coverage detected