Skip to content
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

Clean up Sauce Labs browsers #2149

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: node_js
node_js:
- iojs
before_script:
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then curl https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh
| bash; fi
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
Expand Down
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']);
}
});
};
31 changes: 22 additions & 9 deletions grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,28 @@ 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: [
/* [platform, browserName, version] - version will default to latest stable version */
['OS X 10.10', 'safari', ''],
['WIN8.1', 'chrome', ''],
['WIN8.1', 'internet explorer', ''],
['', 'iPad', '8.2'],
['', 'Android', '']
],
tunneled: true,
build: process.env.TRAVIS_BUILD_NUMBER,
testname: process.env.TRAVIS_BUILD_NUMBER + process.env.TRAVIS_BRANCH,
throttled: 3,
'max-duration': 500,
maxRetries: 3
}
}
},
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">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do exactly?

(Also, technically, the type isn't necessary in scripts anymore :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows you to see the test results in Sauce Labs.
https://saucelabs.com/tests/68dcb9204fb94091996679fa2299f054

Should I just put this in globals-shim.js?

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
60 changes: 1 addition & 59 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,4 @@
module.exports = function(config) {
var customLaunchers = {
chrome_sl: {
singleRun: true,
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 8.1',
version: '34'
},

firefox_sl: {
singleRun: true,
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Linux',
version: '29'
},

safari_sl: {
singleRun: true,
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.8'
},

ipad_sl: {
singleRun: true,
base: 'SauceLabs',
browserName: 'ipad',
platform:'OS X 10.9',
version: '7.1'
},

android_sl: {
singleRun: true,
base: 'SauceLabs',
browserName: 'android',
platform:'Linux'
},

ie_sl: {
singleRun: true,
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
}
};

config.set({
basePath: '',

Expand Down Expand Up @@ -74,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 @@ -94,15 +45,6 @@ module.exports = function(config) {

browserNoActivityTimeout: 60000,

sauceLabs: {
startConnect: true,
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,

// 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.
coverageReporter: {
Expand Down