Skip to content

Commit 5ac691e

Browse files
authoredDec 30, 2016
[chore] Update zuul config to speed up tests in browser (#58)
1 parent c2d0a08 commit 5ac691e

File tree

5 files changed

+35
-50
lines changed

5 files changed

+35
-50
lines changed
 

‎.travis.yml

+2-32
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,5 @@ git:
1111
depth: 1
1212
matrix:
1313
include:
14-
- node_js: '0.12'
15-
env: BROWSER_NAME=chrome BROWSER_VERSION=latest
16-
- node_js: '0.12'
17-
env: BROWSER_NAME=safari BROWSER_VERSION=latest
18-
- node_js: '0.12'
19-
env: BROWSER_NAME=firefox BROWSER_VERSION=latest BROWSER_PLATFORM="Windows 10"
20-
- node_js: '0.12'
21-
env: BROWSER_NAME=ie BROWSER_VERSION=6
22-
- node_js: '0.12'
23-
env: BROWSER_NAME=ie BROWSER_VERSION=7
24-
- node_js: '0.12'
25-
env: BROWSER_NAME=ie BROWSER_VERSION=8
26-
- node_js: '0.12'
27-
env: BROWSER_NAME=ie BROWSER_VERSION=9
28-
- node_js: '0.12'
29-
env: BROWSER_NAME=ie BROWSER_VERSION=10 BROWSER_PLATFORM="Windows 2012"
30-
- node_js: '0.12'
31-
env: BROWSER_NAME=ie BROWSER_VERSION=latest BROWSER_PLATFORM="Windows 2012"
32-
- node_js: '0.12'
33-
env: BROWSER_NAME=microsoftedge BROWSER_VERSION=13 BROWSER_PLATFORM="Windows 10"
34-
- node_js: '0.12'
35-
env: BROWSER_NAME=iphone BROWSER_VERSION=8.4
36-
- node_js: '0.12'
37-
env: BROWSER_NAME=iphone BROWSER_VERSION=9.2
38-
- node_js: '0.12'
39-
env: BROWSER_NAME=android BROWSER_VERSION=4.3
40-
- node_js: '0.12'
41-
env: BROWSER_NAME=android BROWSER_VERSION=4.4
42-
- node_js: '0.12'
43-
env: BROWSER_NAME=android BROWSER_VERSION=5.1
44-
- node_js: '0.12'
45-
env: BROWSER_NAME=android BROWSER_VERSION=latest
14+
- node_js: 'node'
15+
env: BROWSERS=1

‎.zuul.yml

-5
This file was deleted.

‎Makefile

+3-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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 \
@@ -11,17 +11,7 @@ test-node:
1111
test/index.js
1212

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

2717
.PHONY: test

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"benchmark": "2.1.2",
2222
"expect.js": "0.3.1",
2323
"mocha": "3.2.0",
24+
"socket.io-browsers": "^1.0.0",
2425
"zuul": "3.11.1",
2526
"zuul-ngrok": "4.0.0"
2627
},

‎zuul.config.js

+29
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)
Please sign in to comment.