Skip to content

Commit

Permalink
testutils: fix pg dump path
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisvisco committed May 19, 2024
1 parent fa92bcd commit 2fff671
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
go-version: '1.22'

- name: Setup pg_dump
run: sudo apt-get install postgresql-client
run: |
sudo apt-get install postgresql-client
which pg_dump
- name: Wait for PostgreSQL to be ready
run: |
Expand Down
10 changes: 8 additions & 2 deletions pkg/utils/testutils/snapshoting.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ func MaySnapshotSavePgDump(t TestingT, schemaName string, db schema.DatabaseCred

env := map[string]string{"PGPASSWORD": db.Pass}

_, _, err = cmdexec.Exec(getPgDumpPath(), args, env)
_, stderr, err := cmdexec.Exec(getPgDumpPath(), args, env)
if err != nil {
fmt.Println(stderr)
}
require.NoError(t, err)

return
Expand Down Expand Up @@ -168,7 +171,10 @@ func AssertSnapshotPgDumpDiff(t TestingT, schemaName string, db schema.DatabaseC

env := map[string]string{"PGPASSWORD": db.Pass}

_, _, err := cmdexec.Exec(getPgDumpPath(), args, env)
_, stderr, err := cmdexec.Exec(getPgDumpPath(), args, env)
if err != nil {
fmt.Println(stderr)
}
require.NoError(t, err)

snap, err := os.ReadFile(fileSnap)
Expand Down

0 comments on commit 2fff671

Please sign in to comment.