Skip to content

Commit

Permalink
dumb: ugly travis commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Norling committed Feb 13, 2019
1 parent aad4484 commit 27eab2c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,4 @@ addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
env:
global:
- PGPORT=5433
5 changes: 1 addition & 4 deletions test/travis_before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
set -x

PSQL_VERSION="10"
UBUNTU_VERSION="18.04"
PSQL_PORT="5433"

docker pull postgres:"${PSQL_VERSION}"
docker pull ubuntu:"${UBUNTU_VERSION}"

docker run --rm --name swefreq_postgres_${PSQL_VERSION} \
-d -p $PSQL_PORT:5432 postgres:"${PSQL_VERSION}"
docker run --rm -d -p $PSQL_PORT:5432 postgres:"${PSQL_VERSION}"
14 changes: 7 additions & 7 deletions test/travis_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -xe
## SETUP SETTINGS
cp settings_sample.json settings.json
sed -i.tmp 's/"postgresHost" : "postgres host"/"postgresHost" : "127.0.0.1"/' settings.json
sed -i.tmp 's/"postgresPort" : 5432/"postgresPort" : 5433/' settings.json
sed -i.tmp 's/"postgresName" : ""/"postgresName" : "swefreq_test"/' settings.json

echo "SETTINGS"
cat settings.json
Expand All @@ -15,20 +15,20 @@ echo ">>> Test 1. The SQL Patch"
LATEST_RELEASE=$(git tag | grep '^v' | sort -V | tail -n 1)
git show ${LATEST_RELEASE}:sql/*_schema.sql > master-schema.sql

psql -U postgres -h 127.0.0.1 -p 5433 -f master-schema.sql
psql -U postgres -h 127.0.0.1 -p 5433 -f sql/patch-master-db.sql
psql -U postgres -h 127.0.0.1 -p 5432 swefreq_test -f master-schema.sql
psql -U postgres -h 127.0.0.1 -p 5432 swefreq_test -f sql/patch-master-db.sql

# Empty the database
psql -U postgres -h 127.0.0.1 -p 5433 <<__END__
psql -U postgres -h 127.0.0.1 -p 5432 swefreq_test <<__END__
DROP SCHEMA data;
DROP SCHEMA users;
__END__


echo ">>> Test 2. Load the swefreq schema"
psql -U postgres -h 127.0.0.1 -p 5433 -f sql/data_schema.sql
psql -U postgres -h 127.0.0.1 -p 5433 -f sql/user_schema.sql
psql -U postgres -h 127.0.0.1 -p 5433 -f test/data/load_dummy_data.sql
psql -U postgres -h 127.0.0.1 -p 5432 swefreq_test -f sql/data_schema.sql
psql -U postgres -h 127.0.0.1 -p 5432 swefreq_test -f sql/user_schema.sql
psql -U postgres -h 127.0.0.1 -p 5432 swefreq_test -f test/data/load_dummy_data.sql

echo ">>> Test 3. Check that the backend starts"

Expand Down

0 comments on commit 27eab2c

Please sign in to comment.