Skip to content

Commit 387be05

Browse files
[chore] Fix Saucelabs tests (#532)
1 parent 54c0438 commit 387be05

File tree

4 files changed

+53
-32
lines changed

4 files changed

+53
-32
lines changed

.travis.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,43 @@ node_js:
44
- '0.10'
55
- '0.12'
66
- '4'
7-
- 'node'
7+
- '6'
8+
- '7'
89
git:
910
depth: 1
1011
notifications:
1112
irc: "irc.freenode.org#socket.io"
1213
matrix:
1314
include:
1415
- node_js: 'node'
15-
env: BROWSERS=1
16+
env: BROWSER_NAME=chrome BROWSER_VERSION=latest
17+
- node_js: 'node'
18+
env: BROWSER_NAME=safari BROWSER_VERSION=latest
19+
- node_js: 'node'
20+
env: BROWSER_NAME=firefox BROWSER_VERSION=latest
21+
- node_js: 'node'
22+
env: BROWSER_NAME=ie BROWSER_VERSION=6
23+
- node_js: 'node'
24+
env: BROWSER_NAME=ie BROWSER_VERSION=7
25+
- node_js: 'node'
26+
env: BROWSER_NAME=ie BROWSER_VERSION=8
27+
- node_js: 'node'
28+
env: BROWSER_NAME=ie BROWSER_VERSION=9
29+
- node_js: 'node'
30+
env: BROWSER_NAME=ie BROWSER_VERSION=10
31+
- node_js: 'node'
32+
env: BROWSER_NAME=ie BROWSER_VERSION=11
33+
- node_js: 'node'
34+
env: BROWSER_NAME=iphone BROWSER_VERSION=8.4
35+
- node_js: 'node'
36+
env: BROWSER_NAME=iphone BROWSER_VERSION=9.2
37+
- node_js: 'node'
38+
env: BROWSER_NAME=iphone BROWSER_VERSION=10.0
39+
- node_js: 'node'
40+
env: BROWSER_NAME=android BROWSER_VERSION=4.4
41+
- node_js: 'node'
42+
env: BROWSER_NAME=android BROWSER_VERSION=5.1
43+
- node_js: 'node'
44+
env: BROWSER_NAME=ipad BROWSER_VERSION=9.3
45+
- node_js: 'node'
46+
env: BROWSER_NAME=ipad BROWSER_VERSION=10.0

gulpfile.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const FILES_TO_CLEAN = [
3838
];
3939

4040
gulp.task('test', ['lint'], function () {
41-
if (process.env.hasOwnProperty('BROWSERS')) {
41+
if (process.env.hasOwnProperty('BROWSER_NAME')) {
4242
return testZuul();
4343
} else {
4444
return testNode();
@@ -78,7 +78,18 @@ function testNode () {
7878
// runs zuul through shell process
7979
function testZuul () {
8080
const ZUUL_CMD = './node_modules/zuul/bin/zuul';
81-
const zuulChild = child.spawn(ZUUL_CMD, [ TEST_FILE ], { stdio: 'inherit' });
81+
const args = [
82+
'--browser-name',
83+
process.env.BROWSER_NAME,
84+
'--browser-version',
85+
process.env.BROWSER_VERSION
86+
];
87+
if (process.env.hasOwnProperty('BROWSER_PLATFORM')) {
88+
args.push('--browser-platform');
89+
args.push(process.env.BROWSER_PLATFORM);
90+
}
91+
args.push(TEST_FILE);
92+
const zuulChild = child.spawn(ZUUL_CMD, args, { stdio: 'inherit' });
8293
zuulChild.on('exit', function (code) {
8394
cleanFiles(FILES_TO_CLEAN);
8495
process.exit(code);

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"gulp-task-listing": "1.0.1",
5959
"istanbul": "0.2.3",
6060
"mocha": "1.16.2",
61-
"socket.io-browsers": "^1.0.0",
6261
"webpack": "1.12.12",
6362
"webpack-stream": "3.1.0",
6463
"zuul": "3.11.0",

zuul.config.js

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,12 @@
1-
'use strict';
21

3-
var browsers = require('socket.io-browsers');
4-
5-
var zuulConfig = module.exports = {
2+
module.exports = {
63
ui: 'mocha-bdd',
74
server: './test/support/server.js',
5+
tunnel: {
6+
type: 'ngrok',
7+
authtoken: '6Aw8vTgcG5EvXdQywVvbh_3fMxvd4Q7dcL2caAHAFjV',
8+
proto: 'tcp'
9+
},
810
builder: 'zuul-builder-webpack',
9-
webpack: require('./support/webpack.config.js'),
10-
11-
// test on localhost by default
12-
local: true,
13-
14-
concurrency: 2, // ngrok only accepts two tunnels by default
15-
// if browser does not sends output in 120s since last output:
16-
// stop testing, something is wrong
17-
browser_output_timeout: 120 * 1000,
18-
browser_open_timeout: 60 * 4 * 1000,
19-
// we want to be notified something is wrong asap, so no retry
20-
browser_retries: 1
11+
webpack: require('./support/webpack.config.js')
2112
};
22-
23-
if (process.env.CI === 'true') {
24-
zuulConfig.local = false;
25-
zuulConfig.tunnel = {
26-
type: 'ngrok',
27-
bind_tls: true
28-
};
29-
}
30-
31-
var isPullRequest = process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false';
32-
zuulConfig.browsers = isPullRequest ? browsers.pullRequest : browsers.all;

0 commit comments

Comments
 (0)