Skip to content

Commit

Permalink
Enable postgres on the selenium tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aarranz committed Jul 29, 2018
1 parent 19adaca commit 3f8bbf8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions src/ci_scripts/conf_scripts/postgres-prepare.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
export DB_USER=postgres
export DB_NAME=wirecloud_ci

pip install psycopg2

createdb -U postgres -h ${DB_HOST} -p ${DB_PORT} -O ${DB_USER} ${DB_NAME}
createdb -U postgres -h ${DB_HOST:-localhost} -p ${DB_PORT:-5432} -O ${DB_USER:-postgres} ${DB_NAME:-wirecloud}

cat ${WORKSPACE}/src/ci_scripts/templates/postgres-conf.template >> ${WC_INSTANCE_NAME}/settings.py
8 changes: 4 additions & 4 deletions src/ci_scripts/templates/postgres-conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import os
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['DB_NAME'],
'USER': os.environ['DB_USER'],
'NAME': os.environ.get('DB_NAME', 'wirecloud'),
'USER': os.environ.get('DB_USER', 'postgres'),
'PASSWORD': '',
'HOST': os.environ.get('DB_HOST', ''),
'PORT': os.environ.get('DB_PORT', ''),
'HOST': os.environ.get('DB_HOST', 'localhost'),
'PORT': os.environ.get('DB_PORT', '5432'),
}
}
2 changes: 1 addition & 1 deletion src/ci_scripts/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ "${TEST_SUITE}" == "js_unittests" ]; then
grunt ci
exit
elif [ "${TEST_SUITE}" == "selenium" ]; then
FLAGS="sqlite3 django${DJANGO_VERSION} firefox-local selenium"
FLAGS="postgres django${DJANGO_VERSION} firefox-local selenium"
else
FLAGS="sqlite3 django${DJANGO_VERSION} unittest"
fi
Expand Down

0 comments on commit 3f8bbf8

Please sign in to comment.