Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Test
on:
push:
workflow_dispatch:
inputs:
run_ios:
description: Run the iOS simulator test
type: boolean
default: false

jobs:
testBrowser:
Expand Down Expand Up @@ -120,7 +125,7 @@ jobs:
- name: Run tests
run: npm run test:happy-dom

# Every environment gates now. Where a runtime deviates from the others, the deviation is pinned
# Where a runtime deviates from the others, the deviation is pinned
# in `test/client.test.ts` with `test.fails` rather than excluded from CI, so that the suite goes
# red again once the runtime is fixed and the workaround can come out. See CONTRIBUTING.md.
testWorkerd:
Expand All @@ -138,6 +143,7 @@ jobs:
run: npm run test:workerd

testIos:
if: github.event_name == 'workflow_dispatch' && inputs.run_ios
name: 'Test: iOS Simulator'
timeout-minutes: 20
runs-on: macos-latest
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ The browser tests need Playwright's browsers installed once, with `npx playwrigh

`test:ios` is out of `test:all` because it only runs on macOS with Xcode's iOS platform installed, but do reach for it whenever a report names an iPhone or iPad: Playwright's `webkit` is a desktop build with a different networking stack, so it is not evidence about iOS. It picks an iPhone on the newest installed iOS runtime, preferring one that is already booted; set `IOS_SIMULATOR_DEVICE` to pin a device by name, eg `IOS_SIMULATOR_DEVICE='iPad (A16)' npm run test:ios`. If nothing is installed, `xcodebuild -downloadPlatform iOS` fetches a runtime. The simulator is left booted afterwards, since booting one costs most of a minute.

To run the iOS test in CI, open the **Test** workflow in GitHub Actions, choose **Run workflow**, and check **Run the iOS simulator test**.

The provider (`test/helpers/iosSimulator.ts`) drives the simulator with `simctl` alone - Safari there is opened with `simctl openurl` and reports back over the websocket Vitest already opens, so no WebDriver or Appium stack is involved. That also means nothing in the suite can drive the page: keep the tests free of Vitest's browser locators and `userEvent`, which this provider does not implement.

Use `test.fails` for runtime bugs when a future fix must turn the test red and prompt removal of the workaround:
Expand Down
Loading