From 9c5eba983e3e834f902c5123fc1b2aae83e97eee Mon Sep 17 00:00:00 2001 From: Karel Bilek Date: Wed, 18 Dec 2024 13:09:30 +0100 Subject: [PATCH] Export DSN --- pgtest.go | 3 +++ pgtest_test.go | 1 + 2 files changed, 4 insertions(+) diff --git a/pgtest.go b/pgtest.go index 903a12c..c16d298 100644 --- a/pgtest.go +++ b/pgtest.go @@ -29,6 +29,8 @@ type PG struct { User string Name string + DSN string + persistent bool stderr io.ReadCloser @@ -224,6 +226,7 @@ func start(config *PGConfig) (*PG, error) { Host: sockDir, User: pgUser(isRoot), Name: "test", + DSN: dsn, persistent: config.IsPersistent, diff --git a/pgtest_test.go b/pgtest_test.go index 11c89b9..b843ade 100644 --- a/pgtest_test.go +++ b/pgtest_test.go @@ -37,6 +37,7 @@ func TestPostgreSQLWithConfig(t *testing.T) { assert.NotEmpty(pg.Host) assert.NotEmpty(pg.Name) + assert.NotEmpty(pg.DSN) err = pg.Stop() assert.NoError(err)