diff --git a/.github/workflows/bats-postgres.yml b/.github/workflows/bats-postgres.yml index 464552601..c2aefef04 100644 --- a/.github/workflows/bats-postgres.yml +++ b/.github/workflows/bats-postgres.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 30 services: database: - image: postgres:14 + image: postgres:15 env: POSTGRES_PASSWORD: "secret" ports: @@ -30,6 +30,14 @@ jobs: steps: + - name: "Install pg_dump v15" + # we can remove this when it's released on ubuntu-latest + run: | + sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' + wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null + sudo apt update + sudo apt -qq -y -o=Dpkg::Use-Pty=0 install postgresql-client-15 + - name: "Force machineid" run: | sudo chmod +w /etc/machine-id diff --git a/test/lib/db/instance-postgres b/test/lib/db/instance-postgres index d1ebf81c0..918aa63c9 100755 --- a/test/lib/db/instance-postgres +++ b/test/lib/db/instance-postgres @@ -42,10 +42,9 @@ exec_sql() { setup() { exec_sql "DROP DATABASE IF EXISTS crowdsec_test;" - exec_sql "CREATE DATABASE crowdsec_test;" exec_sql "DROP USER IF EXISTS crowdsec_test;" exec_sql "CREATE USER crowdsec_test WITH ENCRYPTED PASSWORD 'crowdsec_test';" - exec_sql "GRANT ALL PRIVILEGES ON DATABASE crowdsec_test TO crowdsec_test;" + exec_sql "CREATE DATABASE crowdsec_test OWNER crowdsec_test;" } dump() {