From dc384d62f2fcaa532810c76f1bcea21e70954228 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 28 May 2020 10:54:49 -0700 Subject: [PATCH 1/3] Run integration/firestore tests for Firestore code changes --- scripts/run_changed.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/run_changed.js b/scripts/run_changed.js index 6866e5d7c66..4cec6ddecb7 100644 --- a/scripts/run_changed.js +++ b/scripts/run_changed.js @@ -70,7 +70,8 @@ const specialPaths = { 'packages/database' ], 'scripts/emulator-testing/firestore-test-runner.ts': ['packages/firestore'], - 'scripts/emulator-testing/database-test-runner.ts': ['packages/database'] + 'scripts/emulator-testing/database-test-runner.ts': ['packages/database'], + 'packages/firestore': ['integration/firestore'] }; /** @@ -95,10 +96,11 @@ async function getChangedPackages() { return { testAll: true }; } // Files outside a package dir that should trigger its tests. - if (specialPaths[filename]) { - for (const targetPackage of specialPaths[filename]) { - changedPackages[targetPackage] = 'dependency'; - } + const matchingSpecialPaths = Object.keys(specialPaths).filter(path => + filename.startsWith(path) + ); + for (const targetPackage of specialPaths[matchingSpecialPaths]) { + changedPackages[targetPackage] = 'dependency'; } // Check for changed files inside package dirs. const match = filename.match('^(packages(-exp)?/[a-zA-Z0-9-]+)/.*'); From a124493192c94f58cd3486c0b69526a9ad2ae876 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 28 May 2020 11:15:23 -0700 Subject: [PATCH 2/3] www --- packages/firestore/src/core/component_provider.ts | 2 +- scripts/run_changed.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/firestore/src/core/component_provider.ts b/packages/firestore/src/core/component_provider.ts index 285b9e66ac0..f2711f03ce0 100644 --- a/packages/firestore/src/core/component_provider.ts +++ b/packages/firestore/src/core/component_provider.ts @@ -44,7 +44,7 @@ import { } from '../local/memory_persistence'; const MEMORY_ONLY_PERSISTENCE_ERROR_MESSAGE = - 'You are using the memory-only build of Firestore. Persistence support is ' + + 'You ARE using the memory-only build of Firestore. Persistence support is ' + 'only available via the @firebase/firestore bundle or the ' + 'firebase-firestore.js build.'; diff --git a/scripts/run_changed.js b/scripts/run_changed.js index 4cec6ddecb7..9b2ac2113bc 100644 --- a/scripts/run_changed.js +++ b/scripts/run_changed.js @@ -96,12 +96,18 @@ async function getChangedPackages() { return { testAll: true }; } // Files outside a package dir that should trigger its tests. + console.log(filename); const matchingSpecialPaths = Object.keys(specialPaths).filter(path => filename.startsWith(path) ); - for (const targetPackage of specialPaths[matchingSpecialPaths]) { - changedPackages[targetPackage] = 'dependency'; + console.log(matchingSpecialPaths); + for (const matchingSpecialPath of matchingSpecialPaths) { + for (const targetPackage of specialPaths[matchingSpecialPath]) { + changedPackages[targetPackage] = 'dependency'; + } } + console.log(changedPackages); + throw new Error('foo'); // Check for changed files inside package dirs. const match = filename.match('^(packages(-exp)?/[a-zA-Z0-9-]+)/.*'); if (match && match[1]) { From 260ac98c7d3bc0e380a4d7992bcff2ac912bcc78 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 28 May 2020 11:17:28 -0700 Subject: [PATCH 3/3] Test done --- packages/firestore/src/core/component_provider.ts | 2 +- scripts/run_changed.js | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/firestore/src/core/component_provider.ts b/packages/firestore/src/core/component_provider.ts index f2711f03ce0..285b9e66ac0 100644 --- a/packages/firestore/src/core/component_provider.ts +++ b/packages/firestore/src/core/component_provider.ts @@ -44,7 +44,7 @@ import { } from '../local/memory_persistence'; const MEMORY_ONLY_PERSISTENCE_ERROR_MESSAGE = - 'You ARE using the memory-only build of Firestore. Persistence support is ' + + 'You are using the memory-only build of Firestore. Persistence support is ' + 'only available via the @firebase/firestore bundle or the ' + 'firebase-firestore.js build.'; diff --git a/scripts/run_changed.js b/scripts/run_changed.js index 9b2ac2113bc..1931ed6cdda 100644 --- a/scripts/run_changed.js +++ b/scripts/run_changed.js @@ -96,18 +96,14 @@ async function getChangedPackages() { return { testAll: true }; } // Files outside a package dir that should trigger its tests. - console.log(filename); const matchingSpecialPaths = Object.keys(specialPaths).filter(path => filename.startsWith(path) ); - console.log(matchingSpecialPaths); for (const matchingSpecialPath of matchingSpecialPaths) { for (const targetPackage of specialPaths[matchingSpecialPath]) { changedPackages[targetPackage] = 'dependency'; } } - console.log(changedPackages); - throw new Error('foo'); // Check for changed files inside package dirs. const match = filename.match('^(packages(-exp)?/[a-zA-Z0-9-]+)/.*'); if (match && match[1]) {