could run all test in saucelabs now; update .travis.yml accordingly

This commit is contained in:
jelhan 2017-08-01 10:07:44 +02:00
parent 87ad9b0506
commit 36198c7ad1

View file

@ -3,13 +3,14 @@ language: php
matrix:
include:
- env: TEST_EMBER=true TEST_SAUCE=false TEST_API=true
- env: TEST="API"
php: 7
- env: TEST_EMBER=false TEST_SAUCE=false TEST_API=true
- env: TEST="API"
php: 5.6
- env: TEST_EMBER=false TEST_SAUCE=true TEST_API=false
- env: TEST="EMBER"
- env: TEST="SAUCE"
allow_failures:
- env: TEST_EMBER=false TEST_SAUCE=true TEST_API=false
- env: TEST="SAUCE"
dist: trusty
sudo: false
@ -18,23 +19,25 @@ cache:
yarn: true
before_install:
- if [ "$TEST" == "API" ]; then export TEST_API=true; else export TEST_API=false; fi
- if [ "$TEST" == "EMBER" ]; then export TEST_EMBER=true; else export TEST_EMBER=false; fi
- if [ "$TEST" == "SAUCE" ]; then export TEST_SAUCE=true; else export TEST_SAUCE=false; fi
# provide yarn if we are testing ember build
- if $TEST_EMBER || $TEST_SAUCHE; then curl -o- -L https://yarnpkg.com/install.sh | bash; fi
- if $TEST_EMBER || $TEST_SAUCHE; then export PATH=$HOME/.yarn/bin:$PATH; fi
# provide phantomjs to run ember test against (not needed if tests are run against browsers provided by saucelabs)
- if $TEST_EMBER; then yarn global add phantomjs-prebuilt; fi
- if $TEST_EMBER; then phantomjs --version; fi
install:
# install dependencies for client
- if $TEST_EMBER || $TEST_SAUCE; then yarn global add bower; fi
- if $TEST_EMBER || $TEST_SAUCE; then yarn global add bower; fi
- if $TEST_EMBER || $TEST_SAUCE; then yarn install --no-interactive; fi
- if $TEST_EMBER || $TEST_SAUCE; then bower install; fi
# install non development composer requirements for api
- if $TEST_EMBER || $TEST_SAUCE; then cd api/ && composer install --no-dev && cd ..; fi
# install dependencies for api
- if $TEST_API; then cd api/ && composer install && cd ..; fi
before_script:
# Start a server so we can hit the API from integration tests
- if $TEST_EMBER; then ember server --live-reload=false; fi &
# wait for the server to be started
- if $TEST_EMBER; then sleep 10; fi
# http://php.net/manual/de/ini.core.php#ini.always-populate-raw-post-data
- if $TEST_API; then echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
# create a sauce tunnel
@ -44,14 +47,7 @@ script:
# run frontend and integration tests
- if $TEST_EMBER; then yarn test; fi
# test against different browsers using sauce lab
# we can not run the integration tests against api cause api is not available to test instance running at sauce lab
# therefore we only run acceptance tests by filter
# to do so we can not just add the launcher to testem ci configuration
- if $TEST_SAUCE; then node_modules/ember-cli/bin/ember test --launch='SL_chrome,SL_firefox,SL_edge,SL_ie,SL_safari' --test-port 8080 --filter 'Acceptance |'; fi
# install development requirements for api to run api tests
# not be done in install section cause otherwise integration tests would not fail
# if api needs an dependency in production which is specified as development dependency
- if $TEST_API; then cd api/ && composer install && cd ..; fi
- if $TEST_SAUCE; then node_modules/ember-cli/bin/ember test --launch='SL_chrome,SL_firefox,SL_edge,SL_ie,SL_safari' --test-port 8080; fi
# run api tests with composer
- if $TEST_API; then cd api/ && ./vendor/bin/codecept run && cd ..; fi