Skip to content

Commit c6b2d35

Browse files
authored
support specifying custom database url for tests
1 parent d5b0679 commit c6b2d35

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

oui/db_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ func Test_New(t *testing.T) {
1919

2020
t.Run("postgres", func(t *testing.T) {
2121
t.Parallel()
22-
password := os.Getenv("POSTGRES_PASSWORD")
23-
require.NotEqual(t, "", password, "missing POSTGRES_PASSWORD environment variable")
24-
cs := fmt.Sprintf("postgresql://oui:%s@localhost/oui?sslmode=disable", password)
22+
cs := os.Getenv("POSTGRES_URL")
23+
require.NotEqual(t, "", cs, "missing POSTGRES_URL environment variable")
2524
psql, err := oui.CreatePostgresOption(cs)
2625
require.NoError(t, err)
2726
ouidb, err := oui.New(oui.WithVersion("test"), psql)

0 commit comments

Comments
 (0)