MCPcopy
hub / github.com/openfga/openfga / TestPostgresDatastoreStartup

Function TestPostgresDatastoreStartup

pkg/storage/postgres/postgres_test.go:166–180  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

164}
165
166func TestPostgresDatastoreStartup(t *testing.T) {
167 primaryDatastore := storagefixtures.RunDatastoreTestContainer(t, "postgres")
168 primaryURI := primaryDatastore.GetConnectionURI(true)
169
170 cfg := sqlcommon.NewConfig()
171 cfg.ExportMetrics = true
172
173 ds, err := New(primaryURI, cfg)
174 require.NoError(t, err)
175 defer ds.Close()
176
177 status, err := ds.IsReady(context.Background())
178 require.NoError(t, err)
179 require.True(t, status.IsReady)
180}
181
182func TestPostgresDatastoreStatusWithSecondaryDB(t *testing.T) {
183 primaryDatastore := storagefixtures.RunDatastoreTestContainer(t, "postgres")

Callers

nothing calls this directly

Calls 5

NewConfigFunction · 0.92
NewFunction · 0.70
GetConnectionURIMethod · 0.65
CloseMethod · 0.65
IsReadyMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…