Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

Commit

Permalink
Integrate with Sauce Labs
Browse files Browse the repository at this point in the history
  • Loading branch information
ericf committed Nov 23, 2015
1 parent 8bfba2c commit 992cc23
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 6 deletions.
13 changes: 9 additions & 4 deletions .travis.yml
@@ -1,7 +1,12 @@
sudo: false
language: node_js
node_js:
- "0.10"
- "0.12"
- "4.2"
- "5"
- '0.10'
- '0.12'
- '4.2'
- '5'
script: npm run travis
env:
global:
- secure: hUY1MRfIsmk/t3BdLfEmDiObbaeHE2xodP5dMkBfm2/li6QIyFA/9pfGI1HTwLT5AnJmZt4+m0fR84AGiH/SXt4ExPYGXfYLasPUmD8O4wtVyhsoJwpru3qrcH+Dx3NhZ1C+q7ueVJTPsa1uv3fNubeJevAcJNysbEWbrULPQ28=
- secure: oygxyfvLeuJjo5KjczOzpw75DJPtDGxiaWHeJaORK6uaykyAjoi7lW+KhWw2+o37w/KdSMNcgW065EAy/dbEFNZT0iknKh1u6mlnnxEh5ZyUYrvt5eA5E0YU1R68oDHrzzKiA+VVHdzX/wgdFQ02EwmoExAX6UvmpkkwhTURPJ4=
113 changes: 112 additions & 1 deletion Gruntfile.js
Expand Up @@ -18,14 +18,125 @@ module.exports = function (grunt) {
src : 'tmp/src/*.js',
dest : 'lib/'
}
},

connect: {
server: {
options: {
base: '.',
port: 9999
}
}
},

'saucelabs-mocha': {
all: {
options: {
urls: [
'http://127.0.0.1:9999/test/setup/browser-unit.html',
],

build: process.env.TRAVIS_BUILD_NUMBER,
sauceConfig: {
'record-video': false,
'capture-html': false,
'record-screenshots': false,
'command-timeout': 60
},
throttled: 3,
browsers: [
// Chrome
{
browserName: 'chrome',
platform: 'Windows 10',
version: '46'
},
{
browserName: 'chrome',
platform: 'Windows 10',
version: 'beta'
},
{
browserName: 'chrome',
platform: 'Windows 10',
version: 'dev'
},
{
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
},

// Firefox
{
browserName: 'firefox',
platform: 'Windows 10',
version: '42'
},
{
browserName: 'firefox',
platform: 'Windows 10',
version: 'beta'
},
{
browserName: 'firefox',
platform: 'Windows 10',
version: 'dev'
},

// IE/Edge
{
browserName: 'internet explorer',
platform: 'Windows 7',
version: '9'
},
{
browserName: 'internet explorer',
platform: 'Windows 8',
version: '10'
},
{
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
},
{
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '20'
},

// Safari
{
browserName: 'safari',
platform: 'OS X 10.10',
version: '8'
},
{
browserName: 'safari',
platform: 'OS X 10.11',
version: '9'
}
]
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-bundle-jsnext-lib');
grunt.loadNpmTasks('grunt-saucelabs');

grunt.registerTask('saucelabs', [
'connect',
'saucelabs-mocha'
]);

grunt.registerTask('default', [
'clean', 'cjs_jsnext', 'copy'
'clean',
'cjs_jsnext',
'copy'
]);
};
6 changes: 5 additions & 1 deletion package.json
Expand Up @@ -7,8 +7,10 @@
"scripts": {
"prepublish": "grunt",
"browserify": "browserify index.js -s memoizeFormatConstructor > tmp/intl-format-cache.js",
"test:browser": "npm run browserify && grunt saucelabs",
"test:unit": "mocha --require test/setup/node-unit --recursive test/unit/",
"test": "npm run test:unit"
"test": "npm run test:unit",
"travis": "npm test && npm run test:browser"
},
"repository": {
"type": "git",
Expand All @@ -32,7 +34,9 @@
"grunt-bundle-jsnext-lib": "^0.5.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-connect": "^0.11.2",
"grunt-contrib-copy": "^0.7.0",
"grunt-saucelabs": "^8.6.1",
"intl": "^1.0.1",
"intl-messageformat": "^1.2.0",
"intl-relativeformat": "^1.2.0",
Expand Down
27 changes: 27 additions & 0 deletions test/setup/saucelabs-unit.sh
@@ -0,0 +1,27 @@
#!/bin/bash

echo branch $TRAVIS_BRANCH
echo pull request $TRAVIS_PULL_REQUEST

if [[ "false" != "$TRAVIS_PULL_REQUEST" ]]; then
echo "saucelabs testing does not work with pull requests"
exit 0
fi

if [[ "x" == "x$SAUCE_USERNAME" ]]; then
echo $0 "is missing env var SAUCE_USERNAME"
exit 1
fi
if [[ "x" == "x$SAUCE_ACCESS_KEY" ]]; then
echo $0 "is missing env var SAUCE_ACCESS_KEY"
exit 1
fi

build=$$
if [[ "x" != "x$TRAVIS_BUILD_NUMBER" ]]; then
build=$TRAVIS_BUILD_NUMBER
fi
echo build $build

echo
npm run test:browser

0 comments on commit 992cc23

Please sign in to comment.