Skip to content

Commit

Permalink
fix(ci): disable failing browserstack tests, use saucelabs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjbarton committed Jan 7, 2021
1 parent 7bf6876 commit bbff287
Showing 1 changed file with 56 additions and 39 deletions.
95 changes: 56 additions & 39 deletions test/client/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const fs = require('fs')

const TRAVIS_WITH_BS = !!process.env.BROWSER_STACK_ACCESS_KEY
const TRAVIS_WITH_SAUCE = !!process.env.SAUCE_ACCESS_KEY

const launchers = {
// Key names are 'browsers'
const browserStackLaunchers = {
bs_chrome: {
base: 'BrowserStack',
browser: 'chrome',
Expand All @@ -14,34 +16,43 @@ const launchers = {
browser: 'firefox',
os: 'Windows',
os_version: '10'
},
bs_safari: {
base: 'BrowserStack',
browser: 'safari',
browser_version: '9.0',
os_version: 'El Capitan',
os: 'OS X'
},
bs_ie_11: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11.0',
os: 'Windows',
os_version: '10'
},
bs_ie_10: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '10.0',
os: 'Windows',
os_version: '8'
},
bs_ie_9: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '9.0',
os: 'Windows',
os_version: '7'
}
// bs_safari: {
// base: 'BrowserStack',
// browser: 'safari',
// browser_version: '9.0',
// os_version: 'El Capitan',
// os: 'OS X'
// },
// bs_ie_11: {
// base: 'BrowserStack',
// browser: 'ie',
// browser_version: '11.0',
// os: 'Windows',
// os_version: '10'
// },
// bs_ie_10: {
// base: 'BrowserStack',
// browser: 'ie',
// browser_version: '10.0',
// os: 'Windows',
// os_version: '8'
// },
// bs_ie_9: {
// base: 'BrowserStack',
// browser: 'ie',
// browser_version: '9.0',
// os: 'Windows',
// os_version: '7'
// }
}

const sauceLabsLaunchers = {
sl_chrome_linux: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'linux',
version: 'latest'
}
}

Expand All @@ -67,16 +78,16 @@ fs.lstat('node_modules/karma', (err, stats) => {
process.exit(1)
})

let browsers = []
const browsers = ['Chrome']
let launchers = {}

if (process.env.TRAVIS) {
if (TRAVIS_WITH_BS) {
browsers = Object.keys(launchers)
} else {
browsers.push('Firefox')
}
} else {
browsers.push('Chrome')
if (TRAVIS_WITH_BS) {
browsers.push(...Object.keys(browserStackLaunchers))
launchers = Object.assign(launchers, browserStackLaunchers)
}
if (TRAVIS_WITH_SAUCE) {
browsers.push(...Object.keys(sauceLabsLaunchers))
launchers = Object.assign(launchers, sauceLabsLaunchers)
}

module.exports = function (config) {
Expand Down Expand Up @@ -161,7 +172,8 @@ module.exports = function (config) {
'karma-firefox-launcher',
'karma-junit-reporter',
'karma-browserify',
'karma-browserstack-launcher'
'karma-browserstack-launcher',
'karma-sauce-launcher'
],

concurrency: 1,
Expand All @@ -174,6 +186,11 @@ module.exports = function (config) {
// With many browsers the 120 requests per minute limit is hit
// resulting in fails Error: 403 Forbidden (Rate Limit Exceeded)
pollingTimeout: 10000
},

sauceLabs: {
testName: 'Karma client tests: saucelabs',
startConnect: true
}
})
}

0 comments on commit bbff287

Please sign in to comment.