Skip to content

Commit a3a80c7

Browse files
committed
Emulators are cool
1 parent 4954ffa commit a3a80c7

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/workflows/integration_tests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,11 @@ jobs:
735735
uses: actions/setup-python@v2
736736
with:
737737
python-version: ${{ env.pythonVersion }}
738+
- name: Setup Firebase Emulators
739+
run: |
740+
curl -sL firebase.tools | bash
741+
firebase setup:emulators:firestore
742+
firebase emulators:start
738743
- name: Setup integration test deps
739744
run: |
740745
pip install -r scripts/gha/requirements.txt
@@ -804,6 +809,11 @@ jobs:
804809
python-version: ${{ env.pythonVersion }}
805810
- name: Install python deps
806811
run: pip install -r scripts/gha/requirements.txt
812+
- name: Setup Firebase Emulators
813+
run: |
814+
curl -sL firebase.tools | bash
815+
firebase setup:emulators:firestore
816+
firebase emulators:start
807817
- id: get-device-type
808818
run: |
809819
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.android_device }} )"
@@ -888,6 +898,11 @@ jobs:
888898
python-version: ${{ env.pythonVersion }}
889899
- name: Install python deps
890900
run: pip install -r scripts/gha/requirements.txt
901+
- name: Setup Firebase Emulators
902+
run: |
903+
curl -sL firebase.tools | bash
904+
firebase setup:emulators:firestore
905+
firebase emulators:start
891906
- id: get-device-type
892907
run: |
893908
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.ios_device }} )"
@@ -972,6 +987,11 @@ jobs:
972987
python-version: ${{ env.pythonVersion }}
973988
- name: Install python deps
974989
run: pip install -r scripts/gha/requirements.txt
990+
- name: Setup Firebase Emulators
991+
run: |
992+
curl -sL firebase.tools | bash
993+
firebase setup:emulators:firestore
994+
firebase emulators:start
975995
- name: Run tvOS integration tests on Simulator locally
976996
run: |
977997
python scripts/gha/test_simulator.py --testapp_dir testapps \

scripts/gha/test_simulator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ def _run_xctest(gameloop_app, device_id):
352352
"-xctestrun", gameloop_app,
353353
"-destination", "id=%s" % device_id]
354354
logging.info("Running game-loop test: %s", " ".join(args))
355-
result = subprocess.run(args=args, capture_output=True, text=True, check=False)
355+
env = os.environ.copy()
356+
env["USE_FIRESTORE_EMULATOR"] = "true"
357+
result = subprocess.run(args=args, capture_output=True, text=True, check=False, env=env)
356358

357359
if not result.stdout:
358360
logging.info("No xctest result")
@@ -600,7 +602,8 @@ def _run_instrumented_test():
600602
This gameloop app can run integration_test app automatically.
601603
"""
602604
args = ["adb", "shell", "am", "instrument",
603-
"-w", "%s.test/androidx.test.runner.AndroidJUnitRunner" % _GAMELOOP_PACKAGE]
605+
"-w", "%s.test/androidx.test.runner.AndroidJUnitRunner" % _GAMELOOP_PACKAGE,
606+
"-e", "USE_FIRESTORE_EMULATOR", "true"]
604607
logging.info("Running game-loop test: %s", " ".join(args))
605608
subprocess.run(args=args, check=False)
606609

0 commit comments

Comments
 (0)