From 5a755c5c7012a5222a055d3dbb73e0f6e7cce231 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 15 Oct 2024 14:48:26 -0400 Subject: [PATCH 1/4] close file --- .github/workflows/test-all.yml | 5 +++-- scripts/emulator-testing/emulators/emulator.ts | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index eda081d1df7..4172d058c75 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -14,7 +14,7 @@ name: Test All Packages -on: pull_request +on: push env: # make chromedriver detect installed Chrome version and download the corresponding driver @@ -92,7 +92,8 @@ jobs: - name: Run unit tests # Ignore auth and firestore since they're handled in their own separate jobs. run: | - xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci + # xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci + xvfb-run yarn lerna run --scope @firebase/data-connect node scripts/print_test_logs.js env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }} diff --git a/scripts/emulator-testing/emulators/emulator.ts b/scripts/emulator-testing/emulators/emulator.ts index 85f190bcba9..2b06ee96756 100644 --- a/scripts/emulator-testing/emulators/emulator.ts +++ b/scripts/emulator-testing/emulators/emulator.ts @@ -75,7 +75,15 @@ export abstract class Emulator { const reader = resp.body.getReader(); reader.read().then(function readChunk({ done, value }): any { if (done) { - downloadComplete(); + console.log('Emulator download is done.') + writer.close(err => { + if (err) { + downloadFailed(`Failed to close the downloaded emulator file: ${err}`); + } + + console.log('Closed downloaded emulator file.') + downloadComplete(); + }) } else { writer.write(value); return reader.read().then(readChunk); @@ -92,7 +100,6 @@ export abstract class Emulator { downloadPromise.then( () => { - console.log('Download complete'); // Change emulator binary file permission to 'rwxr-xr-x'. // The execute permission is required for it to be able to start // with 'java -jar'. From 069ed523d73fc252f0e25f0877cba65cdb2ff1c8 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 15 Oct 2024 15:36:22 -0400 Subject: [PATCH 2/4] Add test:ci to end of test command in CI --- .github/workflows/test-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 4172d058c75..c89285a67a3 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -93,7 +93,7 @@ jobs: # Ignore auth and firestore since they're handled in their own separate jobs. run: | # xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci - xvfb-run yarn lerna run --scope @firebase/data-connect + xvfb-run yarn lerna run --scope @firebase/data-connect test:ci node scripts/print_test_logs.js env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }} From 64223d1c5be8a61d4bd2936a5ae874034941d30a Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 15 Oct 2024 16:02:52 -0400 Subject: [PATCH 3/4] revert workflow file changes --- .github/workflows/test-all.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index c89285a67a3..eda081d1df7 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -14,7 +14,7 @@ name: Test All Packages -on: push +on: pull_request env: # make chromedriver detect installed Chrome version and download the corresponding driver @@ -92,8 +92,7 @@ jobs: - name: Run unit tests # Ignore auth and firestore since they're handled in their own separate jobs. run: | - # xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci - xvfb-run yarn lerna run --scope @firebase/data-connect test:ci + xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci node scripts/print_test_logs.js env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }} From 720a9e5f45608dec2fa18ebe0ecb610e25caa968 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 15 Oct 2024 16:07:21 -0400 Subject: [PATCH 4/4] format --- scripts/emulator-testing/emulators/emulator.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/emulator-testing/emulators/emulator.ts b/scripts/emulator-testing/emulators/emulator.ts index 2b06ee96756..f149debca14 100644 --- a/scripts/emulator-testing/emulators/emulator.ts +++ b/scripts/emulator-testing/emulators/emulator.ts @@ -75,15 +75,17 @@ export abstract class Emulator { const reader = resp.body.getReader(); reader.read().then(function readChunk({ done, value }): any { if (done) { - console.log('Emulator download is done.') + console.log('Emulator download is done.'); writer.close(err => { if (err) { - downloadFailed(`Failed to close the downloaded emulator file: ${err}`); + downloadFailed( + `Failed to close the downloaded emulator file: ${err}` + ); } - console.log('Closed downloaded emulator file.') + console.log('Closed downloaded emulator file.'); downloadComplete(); - }) + }); } else { writer.write(value); return reader.read().then(readChunk);