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

Add IE11 partitions to travis config #776

Merged
merged 4 commits into from
Dec 16, 2022
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
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ jobs:
env: BROWSER=BrowserStackIe11 SUITE_PARTITION=A
- name: Internet Explorer 11 B
env: BROWSER=BrowserStackIe11 SUITE_PARTITION=B
- name: Internet Explorer 11 C
env: BROWSER=BrowserStackIe11 SUITE_PARTITION=C
- name: Internet Explorer 11 D
env: BROWSER=BrowserStackIe11 SUITE_PARTITION=D
- name: Internet Explorer 11 E
env: BROWSER=BrowserStackIe11 SUITE_PARTITION=E
- name: Internet Explorer 11 F
env: BROWSER=BrowserStackIe11 SUITE_PARTITION=F
- name: iOS 14
env: BROWSER=BrowserStackIos14
- name: iOS 13
Expand Down
16 changes: 11 additions & 5 deletions karma.ci.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const {
const {
BROWSER = 'chrome',
REPORT_COVERAGE = false,
TRAVIS_BUILD_NUMBER
TRAVIS_BUILD_NUMBER,
SUITE_PARTITION = null
} = process.env;

const BROWSER_STACK_CAPABILITY = browserStackCapabilities[BROWSER];
Expand All @@ -27,6 +28,11 @@ function runner (config) {
}

if (BROWSER_STACK_CAPABILITY) {
let localIdentifier = `${Math.round(Math.random() * 100)}-${Date.now()}`;
if (SUITE_PARTITION) {
localIdentifier += `-${SUITE_PARTITION}`;
}

cfg.browserStack = {
project,
build: `${TRAVIS_BUILD_NUMBER || `local unit [${branchName()}]`}`,
Expand All @@ -37,19 +43,19 @@ function runner (config) {
'browserstack.console': 'verbose',
'browserstack.networkLogs': true,
captureTimeout: 1200,
localIdentifier: `${Math.round(Math.random() * 100)}-${Date.now()}`,
pollingTimeout: 4000,
timeout: 1200
timeout: 1200,
localIdentifier,
};
cfg.reporters.push('BrowserStack');
}

console.log(cfg);

config.set(cfg);
};
}

const server = require('./test/server');
require('./test/server');

module.exports = runner;

Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function runner (config) {
config.set(Object.assign({}, staticConfig, { logLevel: config.LOG_INFO }));
}

const server = require('./test/server');
require('./test/server');

runner.staticConfig = staticConfig;

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions test/unit/support/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
* BROWSER=ChromeHeadless SUITE_PARTITION=A make test-unit
*/

const PARTITIONS = ['A', 'B', 'C', 'D', 'E', 'F']; // add letters here and .travis.yml for IE11 as necessary

function skipPartition (testIdx) {
return SUITE_PARTITION !== PARTITIONS[testIdx % PARTITIONS.length];
}

function overrideItForPartitions () {
const origIt = it;
const partition = mod => SUITE_PARTITION === 'A' ? mod : !mod;
let count = 0;

// eslint-disable-next-line no-global-assign
it = function (...args) {
if (typeof args[args.length-1] === 'function' && partition(count++ % 2)) {
if (typeof args[args.length - 1] === 'function' && skipPartition(count++)) {
return origIt.skip(...args);
}
return origIt(...args);
Expand Down