Skip to content

Commit 6da48dc

Browse files
committed
Config firestore integration, test on push
1 parent 5b7c963 commit 6da48dc

File tree

4 files changed

+42
-34
lines changed

4 files changed

+42
-34
lines changed

.github/workflows/cross-browser-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Cross-Browser Test Flow
22

33
on:
44
push:
5-
branches:
6-
- master
5+
# branches:
6+
# - master
77

88
jobs:
99
cross-browser-test:

config/karma.saucelabs.js

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ if (!testConfigFile) {
3131
*/
3232
const browserMap = {
3333
// Desktop
34-
// Chrome_Windows: seleniumLauncher('chrome', 'Windows 10', 'latest'),
35-
// Firefox_Windows: seleniumLauncher('firefox', 'Windows 10', 'latest'),
36-
// Safari_macOS: seleniumLauncher('safari', 'macOS 10.13', 'latest'),
37-
// Edge_Windows: seleniumLauncher('MicrosoftEdge', 'Windows 10', 'latest'),
34+
Chrome_Windows: seleniumLauncher('chrome', 'Windows 10', 'latest'),
35+
Firefox_Windows: seleniumLauncher('firefox', 'Windows 10', 'latest'),
36+
Safari_macOS: seleniumLauncher('safari', 'macOS 10.13', 'latest'),
37+
Edge_Windows: seleniumLauncher('MicrosoftEdge', 'Windows 10', 'latest'),
3838
IE_Windows: seleniumLauncher('internet explorer', 'Windows 10', 'latest')
3939

4040
// Mobile
@@ -50,15 +50,16 @@ const packageConfigs = {
5050
// Messaging currently only supports these browsers.
5151
browsers: ['Chrome_Windows', 'Firefox_Windows', 'Edge_Windows']
5252
},
53-
// Firestore has large number of IE test failures, need to spend time to fix.
54-
// firestore: {
55-
// browsers: [
56-
// 'Chrome_Windows',
57-
// 'Firefox_Windows',
58-
// 'Edge_Windows',
59-
// 'Safari_macOS'
60-
// ]
61-
// },
53+
// Firestore unit tests have OOM problems compiling with Babel for IE.
54+
// Firestore integration/firestore tests do run on all browsers.
55+
'packages/firestore': {
56+
browsers: [
57+
'Chrome_Windows',
58+
'Firefox_Windows',
59+
'Edge_Windows',
60+
'Safari_macOS'
61+
]
62+
},
6263
// Installations has IE errors related to `idb` library that need to be figured out.
6364
installations: {
6465
browsers: [
@@ -75,11 +76,14 @@ const packageConfigs = {
7576
*
7677
* @param {string} packageName Name of package being tested (e.g., "firestore")
7778
*/
78-
function getSauceLabsBrowsers(packageName) {
79-
if (packageConfigs[packageName]) {
79+
function getSauceLabsBrowsers(packageName, packageType) {
80+
const packageConfig =
81+
packageConfigs[packageName] ||
82+
packageConfigs[`${packageType}/${packageName}`];
83+
if (packageConfig) {
8084
const filteredBrowserMap = {};
8185
for (const browserKey in browserMap) {
82-
if (packageConfigs[packageName].browsers.includes(browserKey)) {
86+
if (packageConfig.browsers.includes(browserKey)) {
8387
filteredBrowserMap[browserKey] = browserMap[browserKey];
8488
}
8589
}
@@ -109,10 +113,14 @@ function getPackageLabels() {
109113
*/
110114
function getTestFiles() {
111115
let root = path.resolve(__dirname, '..');
112-
const { name: packageName } = getPackageLabels();
116+
const { name: packageName, type: packageType } = getPackageLabels();
113117
let patterns = require(path.join(root, testConfigFile)).files;
114118
let dirname = path.dirname(testConfigFile);
115-
return { packageName, files: patterns.map(p => path.join(dirname, p)) };
119+
return {
120+
packageName,
121+
packageType,
122+
files: patterns.map(p => path.join(dirname, p))
123+
};
116124
}
117125

118126
function seleniumLauncher(browserName, platform, version) {
@@ -156,8 +164,8 @@ function appiumLauncher(
156164
}
157165

158166
module.exports = function(config) {
159-
const { packageName, files: testFiles } = getTestFiles();
160-
const sauceLabsBrowsers = getSauceLabsBrowsers(packageName);
167+
const { packageName, packageType, files: testFiles } = getTestFiles();
168+
const sauceLabsBrowsers = getSauceLabsBrowsers(packageName, packageType);
161169

162170
const sauceLabsConfig = {
163171
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER + '-' + packageName,

packages/polyfill/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ import 'core-js/features/symbol/iterator';
3838
import 'core-js/features/map';
3939
import 'core-js/features/set';
4040
import 'core-js/features/number/is-integer';
41+
import 'core-js/features/number/is-nan';

scripts/run_saucelabs.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ async function runTest(testFile) {
7474
}
7575
}
7676
if (testFile.includes('integration/firestore')) {
77-
// console.log(
78-
// chalk`{blue Generating memory-only build for integration/firestore.}`
79-
// );
80-
// await spawn('yarn', ['--cwd', 'integration/firestore', 'build:memory'], {
81-
// stdio: 'inherit'
82-
// });
83-
// console.log(
84-
// chalk`{blue Running tests on memory-only build for integration/firestore.}`
85-
// );
86-
// const exitCode1 = await runKarma(testFile, 'memory');
77+
console.log(
78+
chalk`{blue Generating memory-only build for integration/firestore.}`
79+
);
80+
await spawn('yarn', ['--cwd', 'integration/firestore', 'build:memory'], {
81+
stdio: 'inherit'
82+
});
83+
console.log(
84+
chalk`{blue Running tests on memory-only build for integration/firestore.}`
85+
);
86+
const exitCode1 = await runKarma(testFile, 'memory');
8787
console.log(
8888
chalk`{blue Generating persistence build for integration/firestore.}`
8989
);
@@ -96,8 +96,7 @@ async function runTest(testFile) {
9696
chalk`{blue Running tests on persistence build for integration/firestore.}`
9797
);
9898
const exitCode2 = await runKarma(testFile, 'persistence');
99-
// return Math.max(exitCode1, exitCode2);
100-
return exitCode2;
99+
return Math.max(exitCode1, exitCode2);
101100
} else {
102101
return runKarma(testFile);
103102
}

0 commit comments

Comments
 (0)