Skip to content

Commit b2b4cfb

Browse files
authored
Enable iOS tests on CI (#443)
1 parent 3d93f97 commit b2b4cfb

4 files changed

Lines changed: 37 additions & 14 deletions

File tree

.github/workflows/main.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ jobs:
3939
- docker
4040
- genrules
4141
- go
42-
#- ios # TODO: fix ios builds
42+
- ios
4343
- java
4444
- kotlin
4545
- perl
4646
- scala
4747
- swift
4848
- typescript
4949
execution_type: [remote, local]
50+
include:
51+
- arch: arm64
52+
- os: macos
5053

5154
steps:
5255
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"
@@ -61,8 +64,8 @@ jobs:
6164

6265
- name: Build and test
6366
env:
64-
ARCH: arm64
65-
OS: macos
67+
ARCH: ${{ matrix.arch }}
68+
OS: ${{ matrix.os }}
6669
EXECUTION_TYPE: ${{ matrix.execution_type }}
6770
APPLE_SDK_VERSION_OVERRIDE: 26.5
6871
run: python3 infra/test-all.py --package=${{ matrix.test_package }}
@@ -89,14 +92,27 @@ jobs:
8992
- docker
9093
- genrules
9194
- go
92-
#- ios # TODO: fix ios builds
95+
- ios
9396
- java
9497
- kotlin
9598
- perl
9699
- scala
97100
- swift
98101
- typescript
99102
execution_type: [remote, local]
103+
include:
104+
- arch: x64
105+
- os: linux
106+
107+
# Override remote ios tests to use macos/arm64 in the remote executor.
108+
- test_package: ios
109+
execution_type: remote
110+
arch: arm64
111+
os: macos
112+
exclude:
113+
# Local ios tests are not supported on linux
114+
- test_package: ios
115+
execution_type: local
100116

101117
steps:
102118
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"
@@ -111,8 +127,8 @@ jobs:
111127

112128
- name: Build and test
113129
env:
114-
ARCH: x64
115-
OS: linux
130+
ARCH: ${{ matrix.arch }}
131+
OS: ${{ matrix.os }}
116132
EXECUTION_TYPE: ${{ matrix.execution_type }}
117133
run: python3 infra/test-all.py --package=${{ matrix.test_package }}
118134

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ locally before attempting remote execution.
6262

6363
- `ios`:
6464

65+
This will only work on a macOS device with XCode (and the necessary iPhone
66+
simulators) installed.
67+
6568
```
6669
# --config=ios is needed to properly set up the device simulators for testing
6770
bazel build --config=ios //ios:all
@@ -90,9 +93,11 @@ locally before attempting remote execution.
9093

9194
- `ios`:
9295

93-
This will only work on a macOS device with XCode (and the necessary iPhone simulators) installed.
96+
This will only work on a macOS device with XCode (and the necessary iPhone
97+
simulators) installed.
9498

9599
```sh
100+
# --config=ios is needed to properly set up the device simulators for testing
96101
bazel test --config=ios //ios:all
97102
```
98103

@@ -158,9 +163,12 @@ isn't enabled in your `.bazelrc.user` file.
158163

159164
- `ios`:
160165

161-
These can only be built remotely on a macOS worker with the matching XCode installed.
166+
These can only be tested remotely on a macOS worker with the matching XCode
167+
installed. However, this means that the local bazel can be executed from linux
168+
or macOS, since all work is done on the remote macOS worker.
162169

163170
```sh
171+
# --config=ios is needed to properly set up the device simulators for testing
164172
bazel build --config=ios --config=remote_macos_arm64 --config=opal //ios:all
165173
```
166174

@@ -186,11 +194,12 @@ isn't enabled in your `.bazelrc.user` file.
186194

187195
- `ios`:
188196

189-
These can only be tested remotely on a macOS worker with the matching XCode installed.
190-
191-
**NOTE:** Currently, `ios_ui_test` on a remote cluster is not working due to a permissions mismatch).
197+
These can only be tested remotely on a macOS worker with the matching XCode
198+
installed. However, this means that the local bazel can be executed from linux
199+
or macOS, since all work is done on the remote macOS worker.
192200

193201
```sh
202+
# --config=ios is needed to properly set up the device simulators for testing
194203
bazel test --config=ios --config=remote_macos_arm64 //ios:all
195204
```
196205

ios/BUILD

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ ios_ui_test(
5050
name = "HelloAppUITest",
5151
minimum_os_version = "26.0",
5252
runner = "@rules_apple//apple/testing/default_runner:ios_xctestrun_ordered_runner",
53-
tags = [
54-
"no-remote-ci", # Investigating permissions error.
55-
],
5653
test_host = ":HelloApp",
5754
deps = [":HelloAppUITestLib"],
5855
)

platform/macos_arm64/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ platform(
1313
],
1414
exec_properties = {
1515
"Pool": "macos_arm_m2",
16+
"test.sandboxAllowed": "False", # ios tests need to escape the sandbox in order to correctly reach the simulator service.
1617
},
1718
)
1819

0 commit comments

Comments
 (0)