Commit 724e402
authored
Fix bugs with macOS test runner (#2754)
Fixes two major issues with the `macos_unit_test` runner
- Tests were always passing because:
```
xcodebuild <...> 2>&1 | tee -i "$testlog" \
|| test_exit_code=$?
```
Without `pipefail` means the exit code of the `xcodebuild` command is
dropped. This meant as of
#2649 all
`macos_unit_test` were always passing even when tests failed 🙈
- Warning when running `xcodebuild`:
```
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64e, id:00006031-001851843684001C, name:My Mac }
{ platform:macOS, arch:arm64, id:00006031-001851843684001C, name:My Mac }
{ platform:macOS, arch:x86_64, id:00006031-001851843684001C, name:My Mac }
{ platform:macOS, arch:arm64e, variant:Mac Catalyst, id:00006031-001851843684001C, name:My Mac }
{ platform:macOS, arch:arm64, variant:Mac Catalyst, id:00006031-001851843684001C, name:My Mac }
{ platform:macOS, arch:x86_64, variant:Mac Catalyst, id:00006031-001851843684001C, name:My Mac }
{ platform:macOS, arch:arm64e, variant:DriverKit, id:00006031-001851843684001C, name:My Mac }
{ platform:macOS, arch:arm64, variant:DriverKit, id:00006031-001851843684001C, name:My Mac }
{ platform:macOS, arch:arm64e, variant:Designed for [iPad,iPhone], id:00006031-001851843684001C, name:My Mac }
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00006031-001851843684001C, name:My Mac }
```
The fix here is to specify `variant=macos` and `arch` so that xcodebuild
always picks the right destination.1 parent 9b2f083 commit 724e402
1 file changed
+5
-2
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
| 154 | + | |
152 | 155 | | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
156 | | - | |
| 159 | + | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| |||
0 commit comments