Skip to content

Commit 9c928b8

Browse files
authored
Fix iOS simulator tests not initializing the device correctly (#1039)
* Update integration_tests.yml * Update integration_tests.yml * Update test_simulator.py
1 parent e1cdd50 commit 9c928b8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/integration_tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ jobs:
478478
strategy:
479479
fail-fast: false
480480
matrix: ${{ fromJson(needs.check_and_prepare.outputs.test_matrix) }}
481+
env:
482+
xcodeVersion: "15.1"
481483
steps:
482484
- id: matrix_info
483485
shell: bash
@@ -495,6 +497,9 @@ jobs:
495497
timeout-minutes: 10
496498
shell: bash
497499
run: pip install -r scripts/gha/requirements.txt
500+
- name: setup Xcode version
501+
if: runner.os == 'macOS'
502+
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
498503
- name: Download Testapp artifacts
499504
uses: actions/download-artifact@v3
500505
with:
@@ -546,6 +551,10 @@ jobs:
546551
run: |
547552
python scripts/gha/read_ftl_test_result.py --test_result '${{ steps.ftl_test.outputs.test_summary }}' \
548553
--output_path testapps/test-results-"${{ steps.matrix_info.outputs.info }}".log
554+
- name: Print available devices
555+
if: ${{ matrix.device_type == 'virtual' && !cancelled() }}
556+
run: |
557+
xcrun xctrace list devices
549558
- name: Run Mobile integration tests on virtual device locally
550559
timeout-minutes: 120
551560
if: ${{ matrix.device_type == 'virtual' && !cancelled() }}

scripts/gha/test_simulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def _create_and_boot_simulator(apple_platform, device_name, device_os):
396396
command = "xcrun xctrace list devices 2>&1 | grep \"%s Simulator (%s)\" | awk -F'[()]' '{print $4}'" % (device_name, device_os)
397397
logging.info("Get test simulator: %s", command)
398398
result = subprocess.Popen(command, universal_newlines=True, shell=True, stdout=subprocess.PIPE)
399-
device_id = result.stdout.read().strip()
399+
device_id = result.stdout.readline().strip()
400400

401401
if not device_id:
402402
# download and create device

0 commit comments

Comments
 (0)