Skip to content

Commit 587c0c3

Browse files
authored
Use FTL Virtual Android devices to run tests (#1138)
1 parent d393355 commit 587c0c3

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

.github/workflows/integration_tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ jobs:
10301030
--logfile_name "android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}" \
10311031
--ci
10321032
- id: ftl_test
1033-
if: steps.device-info.outputs.device_type == 'real'
1033+
if: steps.device-info.outputs.device_type == 'ftl'
10341034
uses: FirebaseExtended/github-actions/[email protected]
10351035
timeout-minutes: 90
10361036
with:
@@ -1041,7 +1041,7 @@ jobs:
10411041
max_attempts: 3
10421042
validator: ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py
10431043
- name: Read FTL Test Result
1044-
if: ${{ steps.device-info.outputs.device_type == 'real' && !cancelled() }}
1044+
if: ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }}
10451045
shell: bash
10461046
run: |
10471047
python scripts/gha/read_ftl_test_result.py --test_result '${{ steps.ftl_test.outputs.test_summary }}' \
@@ -1173,7 +1173,7 @@ jobs:
11731173
--logfile_name "ios-${{ matrix.build_os }}-${{ matrix.ios_device }}-${{ matrix.test_type }}" \
11741174
--ci
11751175
- id: ftl_test
1176-
if: steps.device-info.outputs.device_type == 'real'
1176+
if: steps.device-info.outputs.device_type == 'ftl'
11771177
uses: FirebaseExtended/github-actions/[email protected]
11781178
timeout-minutes: 90
11791179
with:
@@ -1184,7 +1184,7 @@ jobs:
11841184
max_attempts: 3
11851185
validator: ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py
11861186
- name: Read FTL Test Result
1187-
if: ${{ steps.device-info.outputs.device_type == 'real' && !cancelled() }}
1187+
if: ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }}
11881188
shell: bash
11891189
run: |
11901190
python scripts/gha/read_ftl_test_result.py --test_result '${{ steps.ftl_test.outputs.test_summary }}' \

scripts/gha/print_matrix_configuration.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"os": ["ubuntu-latest", "macos-12", "windows-latest"],
104104
"platform": ["Desktop", "Android", "iOS", "tvOS"],
105105
"ssl_lib": ["openssl"],
106-
"android_device": ["android_target", "emulator_target"],
106+
"android_device": ["android_target", "emulator_ftl_target"],
107107
"ios_device": ["ios_target", "simulator_target"],
108108
"tvos_device": ["tvos_simulator"],
109109
"build_type": ["Debug"],
@@ -125,7 +125,7 @@
125125

126126
EXPANDED_KEY: {
127127
"ssl_lib": ["openssl", "boringssl"],
128-
"android_device": ["android_target", "android_latest", "emulator_target", "emulator_latest", "emulator_32bit"],
128+
"android_device": ["android_target", "android_latest", "emulator_ftl_target", "emulator_ftl_latest"],
129129
"ios_device": ["ios_min", "ios_target", "ios_latest", "simulator_min", "simulator_target", "simulator_latest"],
130130
"tvos_device": ["tvos_simulator"],
131131
"architecture_windows_linux": ["x64", "x86"],
@@ -165,16 +165,16 @@
165165
# gcloud firebase test android models list
166166
# gcloud firebase test ios models list
167167
TEST_DEVICES = {
168-
"android_min": {"type": "real", "device": "model=Nexus10,version=19"},
169-
"android_target": {"type": "real", "device": "model=blueline,version=28"},
170-
"android_latest": {"type": "real", "device": "model=oriole,version=33"},
171-
"emulator_min": {"type": "virtual", "image":"system-images;android-18;google_apis;x86"},
168+
"android_target": {"type": "ftl", "device": "model=blueline,version=28"},
169+
"android_latest": {"type": "ftl", "device": "model=oriole,version=33"},
170+
"emulator_ftl_target": {"type": "ftl", "device": "model=Pixel2,version=28"},
171+
"emulator_ftl_latest": {"type": "ftl", "device": "model=Pixel2.arm,version=33"},
172172
"emulator_target": {"type": "virtual", "image":"system-images;android-30;google_apis;x86_64"},
173173
"emulator_latest": {"type": "virtual", "image":"system-images;android-32;google_apis;x86_64"},
174174
"emulator_32bit": {"type": "virtual", "image":"system-images;android-30;google_apis;x86"},
175-
"ios_min": {"type": "real", "device": "model=iphonexr,version=13.2"},
176-
"ios_target": {"type": "real", "device": "model=iphone8,version=13.6"},
177-
"ios_latest": {"type": "real", "device": "model=iphone11pro,version=14.7"},
175+
"ios_min": {"type": "ftl", "device": "model=iphonexr,version=13.2"},
176+
"ios_target": {"type": "ftl", "device": "model=iphone8,version=13.6"},
177+
"ios_latest": {"type": "ftl", "device": "model=iphone11pro,version=14.7"},
178178
"simulator_min": {"type": "virtual", "name":"iPhone 8", "version":"13.7"},
179179
"simulator_target": {"type": "virtual", "name":"iPhone 8", "version":"14.5"},
180180
"simulator_latest": {"type": "virtual", "name":"iPhone 11", "version":"15.2"},
@@ -222,6 +222,7 @@ def get_value(workflow, test_matrix, parm_key, config_parms_only=False):
222222
def filter_devices(devices, device_type):
223223
""" Filter device by device_type
224224
"""
225+
device_type = device_type.replace("real","ftl")
225226
filtered_value = filter(lambda device: TEST_DEVICES.get(device).get("type") in device_type, devices)
226227
return list(filtered_value)
227228

@@ -373,7 +374,7 @@ def main():
373374
else:
374375
test_matrix = ""
375376
value = get_value(args.workflow, test_matrix, args.parm_key, args.config)
376-
if args.workflow == "integration_tests" and (args.parm_key == "android_device" or args.parm_key == "ios_device"):
377+
if args.workflow == "integration_tests" and args.parm_key == "ios_device":
377378
value = filter_devices(value, args.device_type)
378379
if args.auto_diff:
379380
value = filter_values_on_diff(args.parm_key, value, args.auto_diff)

scripts/gha/summarize_test_results.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,22 +388,22 @@ def combine_config(platform, config, config_value, k):
388388
if len(config_value) > 1 and len(config) == len(config_value):
389389
config = ["All %d %s" % (len(config_value), config_name)]
390390
elif config_name == "ios_device":
391-
ftl_devices = set(filter(lambda device: TEST_DEVICES.get(device).get("type") in "real", config_value))
391+
ftl_devices = set(filter(lambda device: TEST_DEVICES.get(device).get("type") in "ftl", config_value))
392392
simulators = set(filter(lambda device: TEST_DEVICES.get(device).get("type") in "virtual", config_value))
393393
if len(ftl_devices) > 1 and ftl_devices.issubset(set(config)):
394394
config.insert(0, "All %d FTL Devices" % len(ftl_devices))
395395
config = [x for x in config if (x not in ftl_devices)]
396396
if len(simulators) > 1 and simulators.issubset(set(config)):
397-
config.insert(0, "All %d Simulators" % len(simulators))
397+
config.insert(0, "All %d Local Simulators" % len(simulators))
398398
config = [x for x in config if (x not in simulators)]
399399
elif config_name == "android_device":
400-
ftl_devices = set(filter(lambda device: TEST_DEVICES.get(device).get("type") in "real", config_value))
400+
ftl_devices = set(filter(lambda device: TEST_DEVICES.get(device).get("type") in "ftl", config_value))
401401
emulators = set(filter(lambda device: TEST_DEVICES.get(device).get("type") in "virtual", config_value))
402402
if len(ftl_devices) > 1 and ftl_devices.issubset(set(config)):
403403
config.insert(0, "All %d FTL Devices" % len(ftl_devices))
404404
config = [x for x in config if (x not in ftl_devices)]
405405
if len(emulators) > 1 and emulators.issubset(set(config)):
406-
config.insert(0, "All %d Emulators" % len(emulators))
406+
config.insert(0, "All %d Local Emulators" % len(emulators))
407407
config = [x for x in config if (x not in emulators)]
408408
# if certain config failed for more than 1 value but not all, add message "x/y" which means "x" out of "y" configs has errors.
409409
if len(config_value) > 1 and config_before_combination == config:

0 commit comments

Comments
 (0)