-
Notifications
You must be signed in to change notification settings - Fork 124
Run Firestore tests against Emulators where possible. #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
acfb8ac
Emulators are cool
wu-hui f1473fa
Background them
wu-hui 4f75914
Test setting xcodebuild directly.
wu-hui 3a21f2e
Add debugging ssh setup
wu-hui 6686e3f
Less pausing.
wu-hui 4f2dd8a
Pause at the right moment
wu-hui a1c05cd
Pause after test
wu-hui 79758f1
More debugging
wu-hui e09e82b
Disable a bunch
wu-hui bc481e0
Bring them back.
wu-hui 96faf1a
Add launch env
wu-hui b538e3c
Directly add to gameloop and testapp
wu-hui f0af295
Setup emulator run properly
wu-hui adddd2c
Revert some changes
wu-hui 225b718
Use the right macro
wu-hui a0306c0
Actually run emulator
wu-hui f919297
Add firestore emulator script
wu-hui aa6d65e
Clean up and ready to go.
wu-hui e6cee6d
Delete script
wu-hui 725b21b
skip windows for now
wu-hui cb3a6ec
Skip windows
wu-hui cfbe26e
Fixing typo
wu-hui 848b41e
Do it for tvOS too
wu-hui a9d0998
Let's fix windows
wu-hui File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ on: | |
mobile_test_on: | ||
description: 'Run mobile tests on real and/or virtual devices? (separated by commas)' | ||
default: 'real,virtual' | ||
required: true | ||
required: true | ||
use_expanded_matrix: | ||
description: 'Use an expanded matrix? Note: above config will be ignored.' | ||
default: '0' | ||
|
@@ -52,8 +52,8 @@ jobs: | |
check_trigger: | ||
### This job runs when the workflow was triggered by 1) PR getting labeled | ||
### 2) PR merged & closed 3) or manumlly triggered with Pull request #. | ||
### If triggered by label, then checks whether the label is a test-request | ||
### trigger (cancelling the workflow if not). | ||
### If triggered by label, then checks whether the label is a test-request | ||
### trigger (cancelling the workflow if not). | ||
### It sets outputs to control the build_* matrix (full or quick) and to tell | ||
### subsequent steps to update the labels as well. | ||
runs-on: ubuntu-latest | ||
|
@@ -461,7 +461,7 @@ jobs: | |
--artifact_name "android-${{ matrix.os }}" \ | ||
--noadd_timestamp \ | ||
--short_output_paths \ | ||
${additional_flags[*]} | ||
${additional_flags[*]} | ||
- name: Prepare results summary artifact | ||
if: ${{ !cancelled() }} | ||
shell: bash | ||
|
@@ -566,7 +566,7 @@ jobs: | |
--artifact_name "ios-macos-latest" \ | ||
--noadd_timestamp \ | ||
--short_output_paths \ | ||
${additional_flags[*]} | ||
${additional_flags[*]} | ||
- name: Prepare results summary artifact | ||
if: ${{ !cancelled() }} | ||
shell: bash | ||
|
@@ -670,7 +670,7 @@ jobs: | |
--artifact_name "tvos-macos-latest" \ | ||
--noadd_timestamp \ | ||
--short_output_paths \ | ||
${additional_flags[*]} | ||
${additional_flags[*]} | ||
- name: Prepare results summary artifact | ||
if: ${{ !cancelled() }} | ||
shell: bash | ||
|
@@ -739,12 +739,21 @@ jobs: | |
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.pythonVersion }} | ||
- name: Set up Node (12) | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12.x | ||
- name: Setup Firestore Emulator | ||
run: | | ||
npm install -g firebase-tools | ||
- name: Setup integration test deps | ||
run: | | ||
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: python scripts/gha/desktop_tester.py --testapp_dir testapps --logfile_name "desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}" | ||
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 | ||
- name: Prepare results summary artifact | ||
if: ${{ !cancelled() }} | ||
shell: bash | ||
|
@@ -773,7 +782,7 @@ jobs: | |
--issue_number ${{needs.check_trigger.outputs.pr_number}}\ | ||
--actor ${{github.actor}} \ | ||
--commit ${{needs.prepare_matrix.outputs.github_ref}} \ | ||
--run_id ${{github.run_id}} | ||
--run_id ${{github.run_id}} | ||
- name: Summarize test results | ||
if: ${{ !cancelled() }} | ||
shell: bash | ||
|
@@ -811,6 +820,15 @@ jobs: | |
- id: get-device-type | ||
run: | | ||
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.android_device }} )" | ||
- name: Set up Node (12) | ||
uses: actions/setup-node@v2 | ||
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 & | ||
- name: Run Android integration tests on Emulator locally | ||
timeout-minutes: 60 | ||
if: steps.get-device-type.outputs.device_type == 'virtual' | ||
|
@@ -896,6 +914,15 @@ jobs: | |
- id: get-device-type | ||
run: | | ||
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.ios_device }} )" | ||
- name: Set up Node (12) | ||
uses: actions/setup-node@v2 | ||
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 & | ||
- name: Run iOS integration tests on Simulator locally | ||
timeout-minutes: 60 | ||
if: steps.get-device-type.outputs.device_type == 'virtual' | ||
|
@@ -929,7 +956,7 @@ jobs: | |
with: | ||
name: log-artifact | ||
path: testapps/test-results-ios-macos-latest-${{ matrix.ios_device }}* | ||
retention-days: ${{ env.artifactRetentionDays }} | ||
retention-days: ${{ env.artifactRetentionDays }} | ||
- name: Download log artifacts | ||
if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }} | ||
uses: actions/[email protected] | ||
|
@@ -978,6 +1005,10 @@ jobs: | |
python-version: ${{ env.pythonVersion }} | ||
- name: Install python deps | ||
run: 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 & | ||
- name: Run tvOS integration tests on Simulator locally | ||
timeout-minutes: 60 | ||
run: | | ||
|
@@ -998,7 +1029,7 @@ jobs: | |
with: | ||
name: log-artifact | ||
path: testapps/test-results-tvos-macos-latest-${{ matrix.tvos_device }}* | ||
retention-days: ${{ env.artifactRetentionDays }} | ||
retention-days: ${{ env.artifactRetentionDays }} | ||
- name: Download log artifacts | ||
if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }} | ||
uses: actions/[email protected] | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know all the detail. But I was wondering why Non-windows need this env.
Isn't
intent.putExtra("USE_FIRESTORE_EMULATOR", "true")
enough to set the env?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is enough for Android. This is running desktop tests.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Then why Windows doesn't test agains Firestore emulator?