Skip to content

Commit 2087eff

Browse files
authored
feat(testing): Always run browser check before BrowserStack tests (getsentry#2446)
If we have an out-of-date, no-longer-supported browser in our BrowserStack browser list, integration tests are necessarily going to fail, so let's bail earlier rather than later. This also increases the timeout so that the BS tests should hopefully be less brittle.
1 parent 9f04983 commit 2087eff

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

packages/browser/scripts/checkbrowsers.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ const checkLocalConfigsVsBrowserStack = (localConfigs, bsConfigs) => {
102102
}
103103
console.log(
104104
'\nPlease visit https://api.browserstack.com/5/browsers or https://api.browserstack.com/5/browsers?flat=true to choose new configurations.',
105+
"\n\n(If you're sure one of the reported browsers is supported, check to make sure the local config contains all keys (even if they have a null value) and that the values match exactly the ones given by the API.)\n",
105106
);
107+
process.exit(-1);
106108
} else {
107109
console.log('\nAll configurations supported!\n');
108110
}
@@ -119,9 +121,14 @@ const checkLocalConfigsVsBrowserStack = (localConfigs, bsConfigs) => {
119121
const findUnsupportedConfigs = localConfigs => {
120122
if (!hasCreds()) {
121123
console.warn(
122-
'Unable to find API credentials in env. Please export them as BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY.',
124+
'Unable to find API credentials in env. Please export them as BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY.\n',
123125
);
124-
return;
126+
process.exit(-1);
127+
}
128+
129+
if (!localConfigs) {
130+
console.warn('Unable to load local browser configurations.\n');
131+
process.exit(-1);
125132
}
126133

127134
fetchCurrentData(browserstackUsername, browserstackAccessKey)

packages/browser/test/integration/suites/loader-specific.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var loaderVariants = [
66
for (var idx in loaderVariants) {
77
(function() {
88
describe(loaderVariants[idx], function() {
9-
this.timeout(5000);
9+
this.timeout(60000);
1010
this.retries(3);
1111

1212
var sandbox;

packages/browser/test/integration/suites/shell.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function runVariant(variant) {
66
var IS_SYNC_LOADER = !!variant.match(/^loader-lazy-no$/);
77

88
describe(variant, function() {
9-
this.timeout(5000);
9+
this.timeout(60000);
1010
this.retries(3);
1111

1212
var sandbox;

packages/core/src/baseclient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ export abstract class BaseClient<B extends Backend, O extends Options> implement
429429
originalException: reason as Error,
430430
});
431431
reject(
432-
`Event processing pipeline threw an error, original event will not be sent. Details has been sent as a new event.\nReason: ${reason}`,
432+
`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`,
433433
);
434434
});
435435
});

scripts/browser-integration.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ yarn
55
# We have to build other packages first, as we use absolute packages import in TypeScript
66
yarn build
77
cd packages/browser
8+
yarn test:integration:checkbrowsers
89
yarn test:integration
910
yarn test:package
10-

0 commit comments

Comments
 (0)