func newSessionRepo(t *testing.T) (session.SessionRepo, clockwork.FakeClock) { clock := clockwork.NewFakeClock() if os.Getenv("DEX_TEST_DSN") == "" { return db.NewSessionRepoWithClock(db.NewMemDB(), clock), clock } dbMap := connect(t) return db.NewSessionRepoWithClock(dbMap, clock), clock }
func makeTestSessionRepoDB(dsn string) func() (session.SessionRepo, clockwork.FakeClock) { return func() (session.SessionRepo, clockwork.FakeClock) { c := initDB(dsn) fc := clockwork.NewFakeClock() return db.NewSessionRepoWithClock(c, fc), fc } }