Skip to content

Commit

Permalink
attempt to make sauce connect more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen authored and Tim McClure committed Dec 12, 2016
1 parent d640234 commit 0bf76d4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
28 changes: 16 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@ language: node_js
node_js: '6'
script:
- npm run build
- npm run travis
- travis_retry npm run travis
sudo: false
cache:
directories:
- node_modules
addons:
sauce_connect:
username: "quill"
access_key: "adc0c0cf-221b-46f1-81b9-a4429b722c2e"
env:
matrix:
- CXX=g++-4.8 BROWSER=mac-chrome-latest
- CXX=g++-4.8 BROWSER=mac-firefox-latest
- CXX=g++-4.8 BROWSER=mac-safari-latest
- CXX=g++-4.8 BROWSER=windows-chrome-latest
- CXX=g++-4.8 BROWSER=windows-firefox-latest
- CXX=g++-4.8 BROWSER=windows-edge-latest
- CXX=g++-4.8 BROWSER=windows-ie-latest
- CXX=g++-4.8 BROWSER=linux-chrome-latest
- CXX=g++-4.8 BROWSER=linux-firefox-latest
- CXX=g++-4.8 BROWSER=ios-latest
- CXX=g++-4.8 BROWSER=android-latest
- BROWSER=mac-chrome-latest
- BROWSER=mac-firefox-latest
- BROWSER=mac-safari-latest
- BROWSER=windows-chrome-latest
- BROWSER=windows-firefox-latest
- BROWSER=windows-edge-latest
- BROWSER=windows-ie-latest
- BROWSER=linux-chrome-latest
- BROWSER=linux-firefox-latest
- BROWSER=ios-latest
- BROWSER=android-latest
5 changes: 3 additions & 2 deletions _develop/browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var desktop = {

var mobile = {
'ios-latest' : ['iPhone 7 Plus', 'iOS', '10.0', 'Safari'],
'ios-previous' : ['iPhone 7 Plus', 'iOS', '9.3', 'Safari'],
'ios-previous' : ['iPhone 6 Plus', 'iOS', '9.3', 'Safari'],

'android-latest' : ['Android Emulator', 'Android', '5.1', 'Browser'],
'android-previous' : ['Android Emulator', 'Android', '5.0', 'Browser']
Expand All @@ -38,10 +38,11 @@ Object.keys(desktop).forEach(function(key) {
});

Object.keys(mobile).forEach(function(key) {
var appiumVersion = key.startsWith('ios') ? '1.6.1' : '1.5.3';
module.exports[key] = {
base: 'SauceLabs',
browserName: mobile[key][3],
appiumVersion: '1.6.1',
appiumVersion: appiumVersion,
deviceName: mobile[key][0],
deviceOrientation: 'portrait',
platformVersion: mobile[key][2],
Expand Down
6 changes: 5 additions & 1 deletion _develop/karma.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,19 @@ module.exports = function(config) {
},
customLaunchers: browsers
});

if (process.env.TRAVIS) {
config.sauceLabs.startConnect = false;
config.transports = ['polling'];
config.browsers = [process.env.BROWSER];
config.browserDisconnectTimeout = 10000;
config.browserDisconnectTolerance = 3;
config.browserNoActivityTimeout = 60000;
config.captureTimeout = 120000;
// MS Edge does not work in an iframe
if (['ios-latest', 'android-latest'].indexOf(process.env.BROWSER) > -1) {
if (process.env.BROWSER.indexOf('ios') > -1 ||
process.env.BROWSER.indexOf('android') > -1 ||
process.env.BROWSER.indexOf('firefox') > -1) {
config.client.useIframe = true;
}
}
Expand Down
14 changes: 8 additions & 6 deletions _develop/sauce.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ var options = {
};

if (process.env.TRAVIS) {
options.build = process.env.TRAVIS_BUILD_ID;
options.tunnel = process.env.TRAVIS_JOB_NUMBER;
module.exports = {
build: process.env.TRAVIS_BUILD_ID,
tunnel: process.env.TRAVIS_JOB_NUMBER
};
} else {
var id = _.random(16*16*16*16).toString(16);
options.build = os.hostname() + '-' + id;
options.tunnel = os.hostname() + '-tunnel-' + id;
module.exports = {
build: os.hostname() + '-' + id,
tunnel: os.hostname() + '-tunnel-' + id
};
}

module.exports = options;

0 comments on commit 0bf76d4

Please sign in to comment.