Skip to content

Commit 38629d3

Browse files
authored
[PM-27522] Test workflows use simulator ID for xcodebuild destinations and remove test retry flags (#2075)
1 parent 25aaf79 commit 38629d3

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

.github/actions/boot-simulator/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ inputs:
1010
description: 'iOS version for the simulator (e.g., 26.0)'
1111
required: true
1212

13+
outputs:
14+
simulator-id:
15+
description: 'The identifier of the booted simulator device'
16+
value: ${{ steps.boot.outputs.device-id }}
17+
1318
runs:
1419
using: 'composite'
1520
steps:
1621
- name: Boot Simulator
22+
id: boot
1723
shell: bash
1824
env:
1925
_SIMULATOR_NAME: ${{ inputs.simulator-name }}
@@ -29,6 +35,7 @@ runs:
2935
xcrun simctl runtime dyld_shared_cache update --all
3036
echo "--------------------------------"
3137
echo "👀 Booting simulator: $_SIMULATOR_NAME ($_SIMULATOR_VERSION) with ID: $DEVICE_ID"
38+
echo "device-id=$DEVICE_ID" >> "$GITHUB_OUTPUT"
3239
3340
i=1
3441
max=5

.github/workflows/test-bwa.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,38 +128,41 @@ jobs:
128128
./Scripts/bootstrap.sh
129129
130130
- name: Boot Simulator
131+
id: boot-simulator
131132
uses: ./.github/actions/boot-simulator
132133
with:
133134
simulator-name: ${{ env._SIMULATOR_NAME }}
134135
simulator-version: ${{ env._SIMULATOR_VERSION }}
135136

136137
- name: Build
138+
env:
139+
_SIMULATOR_ID: ${{ steps.boot-simulator.outputs.simulator-id }}
137140
run: |
138141
python Scripts/pyeetd/main.py & PYEETD_PID=$!
139142
xcrun xcodebuild build-for-testing \
140143
-workspace Bitwarden.xcworkspace \
141144
-scheme Authenticator \
142145
-configuration Debug \
143-
-destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \
146+
-destination "platform=iOS Simulator,id=$_SIMULATOR_ID" \
144147
-derivedDataPath build/DerivedData \
145148
-resultBundlePath "$_BUILD_RESULT_BUNDLE_PATH" \
146149
-quiet
147150
kill "$PYEETD_PID"
148151
149152
- name: Test
153+
env:
154+
_SIMULATOR_ID: ${{ steps.boot-simulator.outputs.simulator-id }}
150155
run: |
151156
python Scripts/pyeetd/main.py & PYEETD_PID=$!
152157
xcrun xcodebuild test-without-building \
153158
-workspace Bitwarden.xcworkspace \
154159
-scheme Authenticator \
155160
-configuration Debug \
156-
-destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \
161+
-destination "platform=iOS Simulator,id=$_SIMULATOR_ID" \
157162
-resultBundlePath "$_TESTS_RESULT_BUNDLE_PATH" \
158163
-derivedDataPath build/DerivedData \
159164
-test-timeouts-enabled yes \
160165
-maximum-test-execution-time-allowance 1 \
161-
-retry-tests-on-failure \
162-
-test-repetition-relaunch-enabled YES \
163166
-quiet
164167
kill "$PYEETD_PID"
165168

.github/workflows/test.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,40 +123,43 @@ jobs:
123123
./Scripts/bootstrap.sh
124124
125125
- name: Boot Simulator
126+
id: boot-simulator
126127
uses: ./.github/actions/boot-simulator
127128
with:
128129
simulator-name: ${{ env._SIMULATOR_NAME }}
129130
simulator-version: ${{ env._SIMULATOR_VERSION }}
130131

131132
- name: Build
133+
env:
134+
_SIMULATOR_ID: ${{ steps.boot-simulator.outputs.simulator-id }}
132135
run: |
133136
python Scripts/pyeetd/main.py & PYEETD_PID=$!
134137
xcrun xcodebuild build-for-testing \
135138
-workspace Bitwarden.xcworkspace \
136139
-scheme Bitwarden \
137140
-configuration Debug \
138-
-destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \
141+
-destination "platform=iOS Simulator,id=$_SIMULATOR_ID" \
139142
-derivedDataPath build/DerivedData \
140143
-resultBundlePath "$_BUILD_RESULT_BUNDLE_PATH" \
141144
-quiet
142145
kill "$PYEETD_PID"
143146
144147
- name: Test
148+
env:
149+
_SIMULATOR_ID: ${{ steps.boot-simulator.outputs.simulator-id }}
145150
run: |
146151
python Scripts/pyeetd/main.py & PYEETD_PID=$!
147152
xcrun xcodebuild test-without-building \
148153
-workspace Bitwarden.xcworkspace \
149154
-scheme Bitwarden \
150155
-configuration Debug \
151-
-destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \
152-
-resultBundlePath $_TESTS_RESULT_BUNDLE_PATH \
156+
-destination "platform=iOS Simulator,id=$_SIMULATOR_ID" \
157+
-resultBundlePath "$_TESTS_RESULT_BUNDLE_PATH" \
153158
-derivedDataPath build/DerivedData \
154159
-test-timeouts-enabled yes \
155160
-maximum-test-execution-time-allowance 1 \
156-
-retry-tests-on-failure \
157-
-test-repetition-relaunch-enabled YES \
158161
-quiet
159-
kill $PYEETD_PID
162+
kill "$PYEETD_PID"
160163
161164
- name: Print Logs Summary
162165
if: always()

0 commit comments

Comments
 (0)