Skip to content

Commit 1fb7f0c

Browse files
author
Chris Stockton
committed
fix: use e2e package for test setup
1 parent 8a398ab commit 1fb7f0c

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

internal/hooks/hookspgfunc/hookspgfunc_test.go

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/gofrs/uuid"
99
"github.com/stretchr/testify/require"
1010
"github.com/supabase/auth/internal/conf"
11+
"github.com/supabase/auth/internal/e2e"
1112
"github.com/supabase/auth/internal/storage"
12-
"github.com/supabase/auth/internal/storage/test"
1313
)
1414

1515
type M = map[string]any
@@ -18,8 +18,8 @@ func TestDispatch(t *testing.T) {
1818
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
1919
defer cancel()
2020

21-
globalCfg := helpConfig(t, apiTestConfig)
22-
db := helpConn(t, globalCfg)
21+
globalCfg := e2e.Must(e2e.Config())
22+
db := e2e.Must(e2e.Conn(globalCfg))
2323

2424
type testCase struct {
2525
ctx context.Context
@@ -225,27 +225,3 @@ func TestDispatch(t *testing.T) {
225225
require.Equal(t, tc.exp, res)
226226
}
227227
}
228-
229-
const (
230-
apiTestConfig = "../../../../hack/test.env"
231-
)
232-
233-
func helpConfig(t testing.TB, configPath string) *conf.GlobalConfiguration {
234-
t.Helper()
235-
236-
config, err := conf.LoadGlobal(configPath)
237-
if err != nil {
238-
t.Fatalf("error loading config %q; got %v", configPath, err)
239-
}
240-
return config
241-
}
242-
243-
func helpConn(t testing.TB, config *conf.GlobalConfiguration) *storage.Connection {
244-
t.Helper()
245-
246-
conn, err := test.SetupDBConnection(config)
247-
if err != nil {
248-
t.Fatalf("error setting up db connection: %v", err)
249-
}
250-
return conn
251-
}

0 commit comments

Comments
 (0)