Skip to content

Update zuul config to speed up tests in browser #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 2 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,5 @@ git:
depth: 1
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,7 +2,7 @@
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 \
Expand All @@ -11,17 +11,7 @@ test-node:
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 @@ -21,6 +21,7 @@
"benchmark": "2.1.2",
"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;