From 4cf213b94c5d259cb04e8b69853bfd83661f26a8 Mon Sep 17 00:00:00 2001 From: Mou Date: Mon, 14 Feb 2022 16:37:01 -0800 Subject: [PATCH 1/4] use firestore emulator when needed --- .github/workflows/integration_tests.yml | 44 +++++++++++++++++-------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 71a855d130..13a76ef4f0 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -801,9 +801,14 @@ jobs: pip install -r scripts/gha/requirements.txt python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" --artifact testapps - name: Run Desktop integration tests - run: firebase emulators:exec --only firestore --project demo-example 'python scripts/gha/desktop_tester.py --testapp_dir testapps --logfile_name "desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}"' env: USE_FIRESTORE_EMULATOR: true + run: | + if [[ "${{ needs.check_and_prepare.outputs.apis }}" == *"firestore"* ]]; then + firebase emulators:exec --only firestore --project demo-example 'python scripts/gha/desktop_tester.py --testapp_dir testapps --logfile_name "desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}"' + else + python scripts/gha/desktop_tester.py --testapp_dir testapps --logfile_name "desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}" + fi - name: Prepare results summary artifact if: ${{ !cancelled() }} shell: bash @@ -883,10 +888,14 @@ jobs: with: node-version: 12.x - name: Setup Firestore Emulator - if: steps.get-device-type.outputs.device_type == 'virtual' - run: | - npm install -g firebase-tools - firebase emulators:start --only firestore --project demo-example & + if: steps.get-device-type.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore') + uses: nick-invision/retry@v2 + with: + timeout_minutes: 3 + max_attempts: 3 + command: | + npm install -g firebase-tools + firebase emulators:start --only firestore --project demo-example & - name: Run Android integration tests on Emulator locally timeout-minutes: 90 if: steps.get-device-type.outputs.device_type == 'virtual' @@ -985,12 +994,16 @@ jobs: with: node-version: 12.x - name: Setup Firestore Emulator - if: steps.get-device-type.outputs.device_type == 'virtual' - run: | - npm install -g firebase-tools - firebase emulators:start --only firestore --project demo-example & + if: steps.get-device-type.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore') + uses: nick-invision/retry@v2 + with: + timeout_minutes: 3 + max_attempts: 3 + command: | + npm install -g firebase-tools + firebase emulators:start --only firestore --project demo-example & - name: Run iOS integration tests on Simulator locally - timeout-minutes: 60 + timeout-minutes: 90 if: steps.get-device-type.outputs.device_type == 'virtual' run: | python scripts/gha/test_simulator.py --testapp_dir testapps \ @@ -1081,9 +1094,14 @@ jobs: max_attempts: 3 command: pip install -r scripts/gha/requirements.txt - name: Setup Firebase Emulators - run: | - npm install -g firebase-tools - firebase emulators:start --only firestore --project demo-example & + if: steps.get-device-type.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore') + uses: nick-invision/retry@v2 + with: + timeout_minutes: 3 + max_attempts: 3 + command: | + npm install -g firebase-tools + firebase emulators:start --only firestore --project demo-example & - name: Run tvOS integration tests on Simulator locally timeout-minutes: 60 run: | From 213d4827086170670d02c33f4da2debf929150ff Mon Sep 17 00:00:00 2001 From: Mou Date: Tue, 15 Feb 2022 11:05:12 -0800 Subject: [PATCH 2/4] fix bash shell --- .github/workflows/integration_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 13a76ef4f0..e9365bca88 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -803,6 +803,7 @@ jobs: - name: Run Desktop integration tests env: USE_FIRESTORE_EMULATOR: true + shell: bash run: | if [[ "${{ needs.check_and_prepare.outputs.apis }}" == *"firestore"* ]]; then firebase emulators:exec --only firestore --project demo-example 'python scripts/gha/desktop_tester.py --testapp_dir testapps --logfile_name "desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}"' From a50be4c0f56e500ce9197c9a2945f902c3e9e437 Mon Sep 17 00:00:00 2001 From: Mou Date: Thu, 17 Feb 2022 10:21:49 -0800 Subject: [PATCH 3/4] remove retry logic which introduce errors on firebase emulator --- .github/workflows/integration_tests.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index e9365bca88..8e6f0a7ccf 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -890,11 +890,7 @@ jobs: node-version: 12.x - name: Setup Firestore Emulator if: steps.get-device-type.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore') - uses: nick-invision/retry@v2 - with: - timeout_minutes: 3 - max_attempts: 3 - command: | + run: | npm install -g firebase-tools firebase emulators:start --only firestore --project demo-example & - name: Run Android integration tests on Emulator locally @@ -996,11 +992,7 @@ jobs: node-version: 12.x - name: Setup Firestore Emulator if: steps.get-device-type.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore') - uses: nick-invision/retry@v2 - with: - timeout_minutes: 3 - max_attempts: 3 - command: | + run: | npm install -g firebase-tools firebase emulators:start --only firestore --project demo-example & - name: Run iOS integration tests on Simulator locally @@ -1095,12 +1087,8 @@ jobs: max_attempts: 3 command: pip install -r scripts/gha/requirements.txt - name: Setup Firebase Emulators - if: steps.get-device-type.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore') - uses: nick-invision/retry@v2 - with: - timeout_minutes: 3 - max_attempts: 3 - command: | + if: contains(needs.check_and_prepare.outputs.apis, 'firestore') + run: | npm install -g firebase-tools firebase emulators:start --only firestore --project demo-example & - name: Run tvOS integration tests on Simulator locally From ded6bd54d5852c9eeb2558000c25f03376161823 Mon Sep 17 00:00:00 2001 From: Mou Date: Thu, 17 Feb 2022 10:23:38 -0800 Subject: [PATCH 4/4] fix file format --- .github/workflows/integration_tests.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8e6f0a7ccf..0d9acbe7df 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -891,8 +891,8 @@ jobs: - name: Setup Firestore Emulator if: steps.get-device-type.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore') run: | - npm install -g firebase-tools - firebase emulators:start --only firestore --project demo-example & + npm install -g firebase-tools + firebase emulators:start --only firestore --project demo-example & - name: Run Android integration tests on Emulator locally timeout-minutes: 90 if: steps.get-device-type.outputs.device_type == 'virtual' @@ -993,8 +993,8 @@ jobs: - name: Setup Firestore Emulator if: steps.get-device-type.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore') run: | - npm install -g firebase-tools - firebase emulators:start --only firestore --project demo-example & + npm install -g firebase-tools + firebase emulators:start --only firestore --project demo-example & - name: Run iOS integration tests on Simulator locally timeout-minutes: 90 if: steps.get-device-type.outputs.device_type == 'virtual' @@ -1086,11 +1086,11 @@ jobs: timeout_minutes: 1 max_attempts: 3 command: pip install -r scripts/gha/requirements.txt - - name: Setup Firebase Emulators + - name: Setup Firestore Emulator if: contains(needs.check_and_prepare.outputs.apis, 'firestore') run: | - npm install -g firebase-tools - firebase emulators:start --only firestore --project demo-example & + npm install -g firebase-tools + firebase emulators:start --only firestore --project demo-example & - name: Run tvOS integration tests on Simulator locally timeout-minutes: 60 run: |