Skip to content

Commit

Permalink
[chore] Update zuul config to speed up tests (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne authored Dec 21, 2016
1 parent 77975d0 commit 339d367
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 50 deletions.
34 changes: 2 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,5 @@ notifications:
irc: irc.freenode.org##socket.io
matrix:
include:
- node_js: '0.12'
env: BROWSER_NAME=chrome BROWSER_VERSION=latest
- node_js: '0.12'
env: BROWSER_NAME=safari BROWSER_VERSION=latest
- node_js: '0.12'
env: BROWSER_NAME=firefox BROWSER_VERSION=latest BROWSER_PLATFORM="Windows 10"
- node_js: '0.12'
env: BROWSER_NAME=ie BROWSER_VERSION=6
- node_js: '0.12'
env: BROWSER_NAME=ie BROWSER_VERSION=7
- node_js: '0.12'
env: BROWSER_NAME=ie BROWSER_VERSION=8
- node_js: '0.12'
env: BROWSER_NAME=ie BROWSER_VERSION=9
- node_js: '0.12'
env: BROWSER_NAME=ie BROWSER_VERSION=10 BROWSER_PLATFORM="Windows 2012"
- node_js: '0.12'
env: BROWSER_NAME=ie BROWSER_VERSION=latest BROWSER_PLATFORM="Windows 2012"
- node_js: '0.12'
env: BROWSER_NAME=microsoftedge BROWSER_VERSION=13 BROWSER_PLATFORM="Windows 10"
- node_js: '0.12'
env: BROWSER_NAME=iphone BROWSER_VERSION=8.4
- node_js: '0.12'
env: BROWSER_NAME=iphone BROWSER_VERSION=9.2
- node_js: '0.12'
env: BROWSER_NAME=android BROWSER_VERSION=4.3
- node_js: '0.12'
env: BROWSER_NAME=android BROWSER_VERSION=4.4
- node_js: '0.12'
env: BROWSER_NAME=android BROWSER_VERSION=5.1
- node_js: '0.12'
env: BROWSER_NAME=android BROWSER_VERSION=latest
- node_js: 'node'
env: BROWSERS=1
5 changes: 0 additions & 5 deletions .zuul.yml

This file was deleted.

16 changes: 3 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,15 @@
REPORTER = dot

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

test-node:
@./node_modules/.bin/mocha \
--reporter $(REPORTER) \
test/index.js

test-zuul:
@if [ "x$(BROWSER_PLATFORM)" = "x" ]; then \
./node_modules/zuul/bin/zuul \
--browser-name $(BROWSER_NAME) \
--browser-version $(BROWSER_VERSION) \
test/index.js; \
else \
./node_modules/zuul/bin/zuul \
--browser-name $(BROWSER_NAME) \
--browser-version $(BROWSER_VERSION) \
--browser-platform "$(BROWSER_PLATFORM)" \
test/index.js; \
fi
@./node_modules/zuul/bin/zuul \
test/index.js

.PHONY: test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"devDependencies": {
"expect.js": "0.3.1",
"mocha": "3.2.0",
"socket.io-browsers": "^1.0.0",
"zuul": "3.11.1",
"zuul-ngrok": "4.0.0"
},
Expand Down
29 changes: 29 additions & 0 deletions zuul.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict';

var browsers = require('socket.io-browsers');

var zuulConfig = module.exports = {
ui: 'mocha-bdd',

// test on localhost by default
local: true,

concurrency: 2, // ngrok only accepts two tunnels by default
// if browser does not sends output in 120s since last output:
// stop testing, something is wrong
browser_output_timeout: 120 * 1000,
browser_open_timeout: 60 * 4 * 1000,
// we want to be notified something is wrong asap, so no retry
browser_retries: 1,
};

if (process.env.CI === 'true') {
zuulConfig.local = false;
zuulConfig.tunnel = {
type: 'ngrok',
bind_tls: true
};
}

var isPullRequest = process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false';
zuulConfig.browsers = isPullRequest ? browsers.pullRequest : browsers.all;

0 comments on commit 339d367

Please sign in to comment.