Skip to content

Commit

Permalink
Replaced karma sauce with grunt-saucelabs
Browse files Browse the repository at this point in the history
  • Loading branch information
jforbes committed May 13, 2015
1 parent 30303b2 commit 5564f3f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 68 deletions.
9 changes: 1 addition & 8 deletions build/tasks/test-travis.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ module.exports = function(grunt) {
if (!process.env.SAUCE_ACCESS_KEY) {
grunt.task.run(['karma:firefox']);
} else {
grunt.task.run([
'karma:chrome_sl',
'karma:firefox_sl',
'karma:safari_sl',
// 'karma:ipad_sl',
// 'karma:android_sl',
'karma:ie_sl'
]);
grunt.task.run([ 'connect:dev', 'saucelabs-qunit' ]);
}
});
};
42 changes: 33 additions & 9 deletions grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,39 @@ module.exports = function(grunt) {
safari: { browsers: ['Safari'] },
ie: { browsers: ['IE'] },
phantomjs: { browsers: ['PhantomJS'] },

// this only runs on PRs from the mainrepo on saucelabs
saucelabs: { browsers: ['chrome_sl'] },
chrome_sl: { browsers: ['chrome_sl'] },
firefox_sl: { browsers: ['firefox_sl'] },
safari_sl: { browsers: ['safari_sl'] },
ipad_sl: { browsers: ['ipad_sl'] },
android_sl: { browsers: ['android_sl'] },
ie_sl: { browsers: ['ie_sl'] }
},
// this only runs on PRs from the mainrepo on saucelabs
'saucelabs-qunit': {
all: {
options: {
urls: [ 'http://127.0.0.1:9999/test/index.html' ],
browsers: [{
browserName: 'chrome',
platform: 'WIN8.1'
}, {
browserName: 'firefox',
platform: 'Linux'
}, {
browserName: 'safari',
platform: 'OS X 10.10'
}, {
browserName: 'iPad',
version: '8.2'
}, {
browserName: 'Android'
}, {
browserName: 'internet explorer',
platform: 'WIN8.1'
}],
tunneled: false,
build: process.env.TRAVIS_BUILD_NUMBER,
testname: process.env.TRAVIS_BUILD_NUMBER + process.env.TRAVIS_BRANCH,
throttled: 3,
sauceConfig: {
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
}
}
}
},
vjsdocs: {
all: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"grunt-github-releaser": "^0.1.17",
"grunt-karma": "^0.8.3",
"grunt-sass": "^0.18.1",
"grunt-saucelabs": "^8.6.1",
"grunt-version": "~0.3.0",
"grunt-videojs-languages": "0.0.4",
"grunt-zip": "0.10.2",
Expand All @@ -70,7 +71,6 @@
"karma-phantomjs-launcher": "^0.1.4",
"karma-qunit": "^0.1.2",
"karma-safari-launcher": "^0.1.1",
"karma-sauce-launcher": "^0.2.8",
"karma-sinon": "^1.0.3",
"load-grunt-tasks": "^3.1.0",
"qunitjs": "~1.14.0",
Expand Down
28 changes: 27 additions & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,33 @@
<body>
<div id="qunit"></div>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>

<script type="text/javascript">
var log = [];
var testName;
QUnit.testStart(function (testDetails) {
QUnit.log = function (details) {
if (!details.result) {
details.name = testDetails.name;
log.push(details);
}
};
});
QUnit.done(function (test_results) {
var tests = [];
for (var i = 0, len = log.length; i < len; i++) {
var details = log[i];
tests.push({
name: details.name,
result: details.result,
expected: details.expected,
actual: details.actual,
source: details.source
});
}
test_results.tests = tests;
window.global_test_results = test_results;
});
</script>
<!-- Execute the bundled tests first -->
<script src="../build/temp/tests.js"></script>

Expand Down
52 changes: 3 additions & 49 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
module.exports = function(config) {
var customLaunchers = {
chrome_sl: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 8.1'
},

firefox_sl: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Linux'
},

safari_sl: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.10'
},

ipad_sl: {
base: 'SauceLabs',
browserName: 'iPad',
version: '8.2'
},

android_sl: {
base: 'SauceLabs',
browserName: 'Android'
},

ie_sl: {
base: 'SauceLabs',
browserName: 'internet explorer'
}
};

config.set({
basePath: '',

Expand Down Expand Up @@ -62,11 +26,10 @@ module.exports = function(config) {
'karma-opera-launcher',
'karma-phantomjs-launcher',
'karma-safari-launcher',
'karma-sauce-launcher',
'karma-coverage'
],

reporters: ['dots', 'saucelabs', 'coverage'],
reporters: ['dots', 'coverage'],

// web server port
port: 9876,
Expand All @@ -78,18 +41,9 @@ module.exports = function(config) {

logLevel: config.LOG_INFO,

captureTimeout: 60000,

browserNoActivityTimeout: 60000,
captureTimeout: 300000,

sauceLabs: {
startConnect: false,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
testName: process.env.TRAVIS_BUILD_NUMBER + process.env.TRAVIS_BRANCH,
recordScreenshots: false
},
customLaunchers: customLaunchers,
browserNoActivityTimeout: 300000,

// The HTML reporter seems to be busted right now, so we're just using text in the meantime
// along with the summary after the test run.
Expand Down

0 comments on commit 5564f3f

Please sign in to comment.