Skip to content

Commit

Permalink
ci: Clean up browserstack test files, remove unused files
Browse files Browse the repository at this point in the history
  • Loading branch information
rmi22186 committed Oct 13, 2023
1 parent 09c385e commit 9b7feae
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 65 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ test/test-bundle.js.map
test/stub/test-stub-bundle.js
**/dist
test/cross-browser-testing/browserstack/reports
browserstack.err
browserstack.err
local.log
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"build:webpack:module": "webpack --config test/integrations/module/webpack/webpack.config.js",
"build:ts": "tsc -p .",
"test": "npm run build && npm run build:test-bundle && cross-env DEBUG=false karma start test/karma.config.js",
"test:browserstack": "karma start test/cross-browser-testing/browserstack/browserstack.karma.config.js",
"test:browserstack:debug": "cross-env DEBUG=true karma start test/cross-browser-testing/browserstack/browserstack.karma.config.js",
"test:browserstack": "karma start test/cross-browser-testing/browserstack.karma.config.js",
"test:browserstack:debug": "cross-env DEBUG=true karma start test/cross-browser-testing/browserstack.karma.config.js",
"test:debug": "cross-env DEBUG=true karma start test/karma.config.js",
"test:stub": "cross-env TESTTYPE=stub ENVIRONMENT=prod rollup --config rollup.test.config.js && karma start test/stub/karma.stub.config.js",
"test:integrations": "npm run test:requirejs && npm run test:integrations:cjs && npm run test:integrations:module",
Expand Down
95 changes: 50 additions & 45 deletions test/cross-browser-testing/browserstack.karma.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const { DEBUG } = process.env;

const files = [
'../../lib/mockhttprequest.js',
'../../lib/geomock.js',
'../../../node_modules/fetch-mock/dist/es5/client-bundle.js',
'../../../node_modules/sinon-browser-only/sinon.js',
'../../config.js',
'../../../dist/mparticle.js',
// currently we are testing the full test suite
'../../test-bundle.js',
'../lib/geomock.js',
'../../node_modules/fetch-mock/dist/es5/client-bundle.js',
'../../dist/mparticle.js',
// TODO: the current test suite includes modern syntax which run successfully
// on newer browsers. We will need to transpile tests to work with older
// browsers - go.mparticle.com/work/SQDSDKS-5834
'../test-bundle.js',
];

let captureConsole = false;
Expand All @@ -29,39 +28,39 @@ if (DEBUG === 'true') {
}

const customLaunchers = {
// These 2 browsers pass because they are capable of running ES6 syntax
// Our tests currently have ES6 syntax in them. They need to be transpiled
bs_firefox_mac_100: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: '100.0',
os: 'OS X',
os_version: 'Ventura'
},
bs_chrome_mac_100: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: '100.0',
os: 'OS X',
os_version: 'Ventura'
},
// These two browsers fail because they cannot run ES6 syntax.
// Our tests have some ES6 syntax in them, so we need to transpile the tests
// to get them to run properly.
// bs_firefox_mac_21: {
// base: 'BrowserStack',
// browser: 'firefox',
// browser_version: '21.0',
// os: 'OS X',
// os_version: 'Snow Leopard'
// },
// bs_chrome_mac_38: {
// base: 'BrowserStack',
// browser: 'chrome',
// browser_version: '38.0',
// os: 'OS X',
// os_version: 'Mojave'
// },
// These 2 browsers pass because they are capable of running ES6 syntax
// Our tests currently have ES6 syntax in them. They need to be transpiled
bs_firefox_mac_100: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: '100.0',
os: 'OS X',
os_version: 'Ventura'
},
bs_chrome_mac_100: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: '100.0',
os: 'OS X',
os_version: 'Ventura'
},
// These two browsers fail because they cannot run ES6 syntax.
// Our tests have some ES6 syntax in them, so we need to transpile the tests
// to get them to run properly.
// bs_firefox_mac_21: {
// base: 'BrowserStack',
// browser: 'firefox',
// browser_version: '21.0',
// os: 'OS X',
// os_version: 'Snow Leopard'
// },
// bs_chrome_mac_38: {
// base: 'BrowserStack',
// browser: 'chrome',
// browser_version: '38.0',
// os: 'OS X',
// os_version: 'Mojave'
// },
}

module.exports = function(config) {
Expand All @@ -70,23 +69,29 @@ module.exports = function(config) {
username: process.env.BS_USERNAME,
accessKey: process.env.BS_ACCESS_KEY
},
autoWatch: false,
customLaunchers,
browsers: Object.keys(customLaunchers),
frameworks: ['mocha', 'should'],
files,
reporters: ['progress', 'junit'],
colors: true,
concurrency: Infinity,
singleRun: true,
debug: true,
logLevel: config.LOG_INFO,
browserConsoleLogOptions,
client: {
captureConsole,
captureConsole,
},
junitReporter: {
outputDir: 'reports/',
outputFile: 'test-karma.xml',
outputDir: 'reports/',
outputFile: 'test-karma.xml',
},
// These settings are added because the connection to Browserstack
// can sometimes be unstable, requiring re-connections, or a longer than
// 2000 ms (default) timeout
browserDisconnectTimeout: 50000,
browserDisconnectTolerance: 5,
concurrency: 5,
});
};
5 changes: 1 addition & 4 deletions test/karma.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
const { DEBUG } = process.env;

let files = [
'lib/mockhttprequest.js',
const files = [
'lib/geomock.js',
'../node_modules/fetch-mock/dist/es5/client-bundle.js',
'../node_modules/sinon-browser-only/sinon.js',
'config.js',
'../dist/mparticle.js',
'test-bundle.js',
];
Expand Down
13 changes: 0 additions & 13 deletions test/runner.js

This file was deleted.

0 comments on commit 9b7feae

Please sign in to comment.