-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(scrips): add a bash scripts to perform integrations tests
- Loading branch information
1 parent
0253fde
commit 03132be
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |