add android and iphone to sauce tests

split up tests so that we have some reports faster
This commit is contained in:
jelhan 2016-04-11 02:11:08 +02:00
parent 48b134c1b2
commit 19546257ad
2 changed files with 52 additions and 17 deletions

View file

@ -3,10 +3,11 @@ language: php
matrix: matrix:
include: include:
- env: TEST_EMBER=true - env: TEST_EMBER=true TEST_SAUCE=false TEST_API=true
php: 7 php: 7
- env: TEST_EMBER=false - env: TEST_EMBER=false TEST_SAUCE=false TEST_API=true
php: 5.6 php: 5.6
- env: TEST_EMBER=false TEST_SAUCE=true TEST_API=false
sudo: false sudo: false
@ -15,17 +16,17 @@ cache:
- node_modules - node_modules
before_install: before_install:
- if $TEST_EMBER; then export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH; fi - if $TEST_EMBER || $TEST_SAUCE; then export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH; fi
- if $TEST_EMBER; then npm config set spin false; fi - if $TEST_EMBER || $TEST_SAUCE; then npm config set spin false; fi
- if $TEST_EMBER; then npm install -g npm@^2; fi - if $TEST_EMBER || $TEST_SAUCE; then npm install -g npm@^2; fi
install: install:
- if $TEST_EMBER; then npm install -g bower; fi - if $TEST_EMBER || $TEST_SAUCE; then npm install -g bower; fi
- if $TEST_EMBER; then npm install; fi - if $TEST_EMBER || $TEST_SAUCE; then npm install; fi
- if $TEST_EMBER; then npm prune; fi - if $TEST_EMBER || $TEST_SAUCE; then npm prune; fi
- if $TEST_EMBER; then bower install; fi - if $TEST_EMBER || $TEST_SAUCE; then bower install; fi
# install non development composer requirements for api # install non development composer requirements for api
- if $TEST_EMBER; then cd api/ && composer install --no-dev && cd ..; fi - if $TEST_EMBER || $TEST_SAUCE; then cd api/ && composer install --no-dev && cd ..; fi
before_script: before_script:
# Start a server so we can hit the API from integration tests # Start a server so we can hit the API from integration tests
@ -33,11 +34,11 @@ before_script:
# wait for the server to be started # wait for the server to be started
- if $TEST_EMBER; then sleep 10; fi - if $TEST_EMBER; then sleep 10; fi
# http://php.net/manual/de/ini.core.php#ini.always-populate-raw-post-data # http://php.net/manual/de/ini.core.php#ini.always-populate-raw-post-data
- echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - if $TEST_API; then echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
# list all installed npm packages # list all installed npm packages
- if $TEST_EMBER; then npm list; fi - if $TEST_EMBER || $TEST_SAUCE; then npm list; fi
# create a sauce tunnel # create a sauce tunnel
- if $TEST_EMBER; then ember start-sauce-connect; fi - if $TEST_SAUCE; then ember sauce:connect; fi
script: script:
# run frontend and integration tests # run frontend and integration tests
@ -46,14 +47,14 @@ script:
# we can not run the integration tests against api cause api is not available to test instance running at 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 # therefore we only run acceptance tests by filter
# to do so we can not just add the launcher to testem ci configuration # to do so we can not just add the launcher to testem ci configuration
- if $TEST_EMBER; then ember test --launch='SL_chrome,SL_firefox,SL_edge,SL_ie,SL_safari' --test-port 8080 --filter 'Acceptance |'; fi - if $TEST_SAUCE; then ember test --launch='SL_chrome,SL_firefox,SL_edge,SL_ie,SL_safari,SL_iphone,SL_android' --test-port 8080 --filter 'Acceptance |'; fi
# install development requirements for api to run api tests # install development requirements for api to run api tests
# not be done in install section cause otherwise integration tests would not fail # 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 api needs an dependency in production which is specified as development dependency
- cd api/ && composer install && cd .. - if $TEST_API; then cd api/ && composer install && cd ..; fi
# run api tests with composer # run api tests with composer
- cd api/ && ./vendor/bin/codecept run && cd .. - if $TEST_API; then cd api/ && ./vendor/bin/codecept run && cd ..; fi
after_script: after_script:
# destroy the sauce tunnel # destroy the sauce tunnel
- if [$TEST_EMBER ]; then ember stop-sauce-connect; fi - if $TEST_SAUCE; then ember sauce:disconnect; fi

View file

@ -97,6 +97,40 @@
"--u" "--u"
], ],
"protocol": "browser" "protocol": "browser"
},
"SL_iphone": {
"exe": "ember",
"args": [
"sauce:launch",
"-b",
"iphone",
"-v",
"9",
"-dn",
"iPhone Simulator",
"--vi",
"public",
"--at",
"--no-ct",
"--u"
],
"protocol": "browser"
},
"SL_android": {
"exe": "ember",
"args": [
"sauce:launch",
"-b",
"android",
"-dn",
"Android Emulator",
"--vi",
"public",
"--at",
"--no-ct",
"--u"
],
"protocol": "browser"
} }
} }
} }