Skip to content

Commit 339d367

Browse files
[chore] Update zuul config to speed up tests (#76)
1 parent 77975d0 commit 339d367

File tree

5 files changed

+35
-50
lines changed

5 files changed

+35
-50
lines changed

.travis.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,5 @@ notifications:
99
irc: irc.freenode.org##socket.io
1010
matrix:
1111
include:
12-
- node_js: '0.12'
13-
env: BROWSER_NAME=chrome BROWSER_VERSION=latest
14-
- node_js: '0.12'
15-
env: BROWSER_NAME=safari BROWSER_VERSION=latest
16-
- node_js: '0.12'
17-
env: BROWSER_NAME=firefox BROWSER_VERSION=latest BROWSER_PLATFORM="Windows 10"
18-
- node_js: '0.12'
19-
env: BROWSER_NAME=ie BROWSER_VERSION=6
20-
- node_js: '0.12'
21-
env: BROWSER_NAME=ie BROWSER_VERSION=7
22-
- node_js: '0.12'
23-
env: BROWSER_NAME=ie BROWSER_VERSION=8
24-
- node_js: '0.12'
25-
env: BROWSER_NAME=ie BROWSER_VERSION=9
26-
- node_js: '0.12'
27-
env: BROWSER_NAME=ie BROWSER_VERSION=10 BROWSER_PLATFORM="Windows 2012"
28-
- node_js: '0.12'
29-
env: BROWSER_NAME=ie BROWSER_VERSION=latest BROWSER_PLATFORM="Windows 2012"
30-
- node_js: '0.12'
31-
env: BROWSER_NAME=microsoftedge BROWSER_VERSION=13 BROWSER_PLATFORM="Windows 10"
32-
- node_js: '0.12'
33-
env: BROWSER_NAME=iphone BROWSER_VERSION=8.4
34-
- node_js: '0.12'
35-
env: BROWSER_NAME=iphone BROWSER_VERSION=9.2
36-
- node_js: '0.12'
37-
env: BROWSER_NAME=android BROWSER_VERSION=4.3
38-
- node_js: '0.12'
39-
env: BROWSER_NAME=android BROWSER_VERSION=4.4
40-
- node_js: '0.12'
41-
env: BROWSER_NAME=android BROWSER_VERSION=5.1
42-
- node_js: '0.12'
43-
env: BROWSER_NAME=android BROWSER_VERSION=latest
12+
- node_js: 'node'
13+
env: BROWSERS=1

.zuul.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,15 @@
22
REPORTER = dot
33

44
test:
5-
@if [ "x$(BROWSER_NAME)" = "x" ]; then make test-node; else make test-zuul; fi
5+
@if [ "x$(BROWSERS)" = "x" ]; then make test-node; else make test-zuul; fi
66

77
test-node:
88
@./node_modules/.bin/mocha \
99
--reporter $(REPORTER) \
1010
test/index.js
1111

1212
test-zuul:
13-
@if [ "x$(BROWSER_PLATFORM)" = "x" ]; then \
14-
./node_modules/zuul/bin/zuul \
15-
--browser-name $(BROWSER_NAME) \
16-
--browser-version $(BROWSER_VERSION) \
17-
test/index.js; \
18-
else \
19-
./node_modules/zuul/bin/zuul \
20-
--browser-name $(BROWSER_NAME) \
21-
--browser-version $(BROWSER_VERSION) \
22-
--browser-platform "$(BROWSER_PLATFORM)" \
23-
test/index.js; \
24-
fi
13+
@./node_modules/zuul/bin/zuul \
14+
test/index.js
2515

2616
.PHONY: test

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"devDependencies": {
88
"expect.js": "0.3.1",
99
"mocha": "3.2.0",
10+
"socket.io-browsers": "^1.0.0",
1011
"zuul": "3.11.1",
1112
"zuul-ngrok": "4.0.0"
1213
},

zuul.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'use strict';
2+
3+
var browsers = require('socket.io-browsers');
4+
5+
var zuulConfig = module.exports = {
6+
ui: 'mocha-bdd',
7+
8+
// test on localhost by default
9+
local: true,
10+
11+
concurrency: 2, // ngrok only accepts two tunnels by default
12+
// if browser does not sends output in 120s since last output:
13+
// stop testing, something is wrong
14+
browser_output_timeout: 120 * 1000,
15+
browser_open_timeout: 60 * 4 * 1000,
16+
// we want to be notified something is wrong asap, so no retry
17+
browser_retries: 1,
18+
};
19+
20+
if (process.env.CI === 'true') {
21+
zuulConfig.local = false;
22+
zuulConfig.tunnel = {
23+
type: 'ngrok',
24+
bind_tls: true
25+
};
26+
}
27+
28+
var isPullRequest = process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false';
29+
zuulConfig.browsers = isPullRequest ? browsers.pullRequest : browsers.all;

0 commit comments

Comments
 (0)