Skip to content

Commit

Permalink
CI: Enable selenium tests on Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
aarranz committed Jun 24, 2018
1 parent 7e9eadf commit 5ae0641
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ matrix:
addons:
firefox: latest-esr
env: TEST_SUITE=js_unittests
- addons:
firefox: "45.0"
env: TEST_SUITE=selenium

install:
- . src/ci_scripts/travis_install.sh
Expand All @@ -34,10 +37,10 @@ before_script:
- . src/ci_scripts/travis_before_script.sh

script:
- src/ci_scripts/travis.sh sqlite3 django$DJANGO_VERSION unittest
- src/ci_scripts/travis.sh

after_success:
- . src/ci_scripts/travis_after_success.sh
- src/ci_scripts/travis_after_success.sh

branches:
only:
Expand Down
11 changes: 6 additions & 5 deletions src/ci_scripts/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ if [ "${TEST_SUITE}" == "js_unittests" ]; then
cd $TRAVIS_BUILD_DIR/src
grunt ci
exit
elif [ "${TEST_SUITE}" == "selenium" ]; then
FLAGS="postgres django${DJANGO_VERSION} selenium"
else
FLAGS="sqlite3 django${DJANGO_VERSION} unittest"
fi


Expand All @@ -16,7 +20,7 @@ COVERAGE_CMD=coverage
RADON_CMD=radon

# Prepip scripts
for conf in $*
for conf in $FLAGS
do
file="${TRAVIS_BUILD_DIR}/src/ci_scripts/conf_scripts/${conf}-prepip.sh"
if [[ -x "$file" ]]
Expand All @@ -32,16 +36,13 @@ pip install ${TRAVIS_BUILD_DIR}/src/dist/wirecloud*.whl
# Install the required testing tools
pip install django-nose mock radon

DJANGO_VERSION=`django-admin.py --version`
DJANGO_VERSION="${DJANGO_VERSION%.*}"

# Create a WireCloud instance
~/virtualenv/python$PYTHON_VERSION/bin/wirecloud-admin startproject ${WC_INSTANCE_NAME}
cd ${WC_INSTANCE_NAME}

# And configure it
cat ${TRAVIS_BUILD_DIR}/src/ci_scripts/base_settings.py >> ${WC_INSTANCE_NAME}/settings.py
for conf in $*
for conf in $FLAGS
do
file="${TRAVIS_BUILD_DIR}/src/ci_scripts/conf_scripts/${conf}-prepare.sh"
if [[ -x "$file" ]]
Expand Down

0 comments on commit 5ae0641

Please sign in to comment.