Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Commit

Permalink
Workaround IE6 Karma-SauceLabs connectivity issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMGreene committed Dec 26, 2015
1 parent dba1fa6 commit 7e45068
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
33 changes: 28 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = function(grunt) {
grunt.registerTask("karma-ci-chain", ["karma:ci"]);
}
else {
var maxConcurrency = 3;
var maxConcurrency = 1;
var karmaConfCi = require("./" + taskConfig.ci.configFile);
var karmaCiTaskChain = [];
karmaConfCi(
Expand All @@ -87,12 +87,35 @@ module.exports = function(grunt) {
}

if (conf.browsers && conf.browsers.length > 0) {
for (var i = 0, len = conf.browsers.length; i < len; i += maxConcurrency) {
var target = {
var i, len, target, targetName,
ie6Regex = /_ie_6\.0$/;

// Workaround for IE6 issue requires it to use the "jsonp-polling" transport:
// https://github.com/karma-runner/karma/issues/983
var ie6Browsers = conf.browsers.filter(function(browserId) {
return ie6Regex.test(browserId);
});
for (i = 0, len = ie6Browsers.length; i < len; i += maxConcurrency) {
target = {
configFile: taskConfig.ci.configFile
};
target.browsers = ie6Browsers.slice(i, i + maxConcurrency);
target.transports = ["jsonp-polling"];
targetName = maxConcurrency === 1 || len === 1 ? target.browsers[0] : "ci_ie6_" + ((i / maxConcurrency) + 1);
taskConfig[targetName] = target;
karmaCiTaskChain.push("karma:" + targetName);
}


var otherBrowsers = conf.browsers.filter(function(browserId) {
return !ie6Regex.test(browserId);
});
for (i = 0, len = otherBrowsers.length; i < len; i += maxConcurrency) {
target = {
configFile: taskConfig.ci.configFile
};
target.browsers = conf.browsers.slice(i, i + maxConcurrency);
var targetName = "ci_" + ((i / maxConcurrency) + 1);
target.browsers = otherBrowsers.slice(i, i + maxConcurrency);
targetName = maxConcurrency === 1 || len === 1 ? target.browsers[0] : "ci_" + ((i / maxConcurrency) + 1);
taskConfig[targetName] = target;
karmaCiTaskChain.push("karma:" + targetName);
}
Expand Down
4 changes: 2 additions & 2 deletions karma.conf-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ function generateCustomLaunchers() {
"10.0": ["Windows 8"],
"9.0": ["Windows 7"],
"8.0": ["Windows 7"],
"7.0": ["Windows XP"]
//, "6.0": ["Windows XP"] // IE6 always fails to connect and times out
"7.0": ["Windows XP"],
"6.0": ["Windows XP"] // IE6 tends to timeout and fail to connect
},
"firefox": {
"dev": ["Windows 7", "OS X 10.10", "Linux"],
Expand Down

0 comments on commit 7e45068

Please sign in to comment.