Skip to content

Commit

Permalink
test(scrips): add a bash scripts to perform integrations tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danvergara committed Apr 4, 2021
1 parent 0253fde commit 03132be
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/test_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
#
# Integartion testing with dockerized database servers
#

set -e

# database credentials
export DBHOST=${DBHOST:-localhost}
export PGUSER="postgres"
export DBPASSWORD="password"
export DATABASE="users"
export PGPORT="15432"

# Test different versions of postgres available on Docker Hub.
pgversions="9.6 10.16 11.11 12.6 13.2"

for i in $pgversions
do
PGVERSION="$i"
echo "--------------BEGIN POSTGRES TESTS-------------"
echo "Running test against PostgreSQL v$PGVERSION"
docker rm -f postgres || true
docker run -p $PGPORT:5432 --name postgres -e POSTGRES_PASSWORD=$DBPASSWORD -d postgres:$PGVERSION
sleep 5
make test
echo "--------------END POSTGRES TESTS-------------"
done

0 comments on commit 03132be

Please sign in to comment.