Skip to content

Commit

Permalink
Fix use PGUSER in RoundTrip test setup/teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-skovenborg authored and hmiguim committed Feb 22, 2024
1 parent 096ca78 commit 843747f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dbptk-core/src/test/resources/postgreSql/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

#ARGS:
# source database name
Expand All @@ -7,8 +7,8 @@
# temporary user password

#ENVIRONMENT VARS:
# DPT_POSTGRESQL_USER - postgres username for a user with permission to create a new user (defaults to "root")
# DPT_POSTGRESQL_PASS - postgres password for the DPT_MYSQL_USER user (defaults to empty)
# DPT_POSTGRESQL_USER - postgres username for a user with permission to create a new user (defaults to "postgres")
# DPT_POSTGRESQL_PASS - postgres password for the DPT_POSTGRESQL_USER user (defaults to empty)

TEST_DB_SOURCE="$1"
TEST_DB_TARGET="$2"
Expand All @@ -24,7 +24,7 @@ fi
export PGPASSWORD="$DPT_POSTGRESQL_PASS"

function sql() {
psql -q -h 127.0.0.1 -U postgres -d postgres --command="$1"
psql -q -h 127.0.0.1 -d postgres --command="$1"
}

# Create test databases
Expand Down
8 changes: 4 additions & 4 deletions dbptk-core/src/test/resources/postgreSql/scripts/teardown.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
#!/usr/bin/env bash

#ARGS:
# source database name
# destination deatabase name
# temporary user username

#ENVIRONMENT VARS:
# DPT_MYSQL_USER - mysql username for a user with permission to create a new user (defaults to "root")
# DPT_MYSQL_PASS - mysql password for the DPT_MYSQL_USER user (defaults to empty)
# DPT_POSTGRESQL_USER - mysql username for a user with permission to create a new user (defaults to "postgres")
# DPT_POSTGRESQL_PASS - mysql password for the DPT_POSTGRESQL_USER user (defaults to empty)

TEST_DB_SOURCE="$1"
TEST_DB_TARGET="$2"
Expand All @@ -22,7 +22,7 @@ fi
export PGPASSWORD="$DPT_POSTGRESQL_PASS"

function sql() {
psql -q -h 127.0.0.1 -U postgres -d postgres --command="$1"
psql -q -h 127.0.0.1 -d postgres --command="$1"
}

sql "DROP DATABASE IF EXISTS \"$TEST_DB_SOURCE\";"
Expand Down

0 comments on commit 843747f

Please sign in to comment.