diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 048a323..ad1f93c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -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: @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 447aae6..f9957f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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: