MCPcopy Create free account
hub / github.com/buggregator/server / setupTestDB

Function setupTestDB

modules/sentry/storage_test.go:11–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func setupTestDB(t *testing.T) *sql.DB {
12 t.Helper()
13 db, err := storage.Open(":memory:")
14 if err != nil {
15 t.Fatal(err)
16 }
17 t.Cleanup(func() { db.Close() })
18
19 // Run sentry migrations.
20 migrator := storage.NewMigrator(db)
21 if err := migrator.AddFromFS("sentry", migrations, "migrations"); err != nil {
22 t.Fatal(err)
23 }
24 if err := migrator.Run(); err != nil {
25 t.Fatal(err)
26 }
27
28 return db
29}
30
31func TestStoreErrorEvent(t *testing.T) {
32 db := setupTestDB(t)

Callers 9

TestStoreErrorEventFunction · 0.70
TestStoreTransactionFunction · 0.70
TestStoreLogsFunction · 0.70
TestHandlerWithDBFunction · 0.70
seedTestDataFunction · 0.70
TestAPIEmptyDatabaseFunction · 0.70

Calls 4

AddFromFSMethod · 0.95
RunMethod · 0.95
OpenFunction · 0.92
NewMigratorFunction · 0.92

Tested by

no test coverage detected