diff --git a/.travis.yml b/.travis.yml index 8b42045a8..ef72d441b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,4 @@ addons: postgresql: "10" apt: packages: - - postgresql-10 - postgresql-client-10 -env: - global: - - PGPORT=5433 diff --git a/test/travis_before_install.sh b/test/travis_before_install.sh index a3ee99d62..07592decd 100755 --- a/test/travis_before_install.sh +++ b/test/travis_before_install.sh @@ -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}" diff --git a/test/travis_script.sh b/test/travis_script.sh index 046f4752f..aec75a1e2 100755 --- a/test/travis_script.sh +++ b/test/travis_script.sh @@ -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 @@ -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"