|
1 | 1 | # Other CI workflows |
2 | 2 |
|
3 | | -TBD — macOS Detox (`tests_e2e_other.yml`), Windows, documentation workflows, and shared actions (caches, Codecov, etc.). |
| 3 | +## macOS Jet e2e (`tests_e2e_other.yml`) |
| 4 | + |
| 5 | +macOS e2e runs **Jet directly** (no Detox): `yarn tests:macos:test-cover`. The test app is a react-native-macos binary launched via `open` in `tests/.jetrc.js`. |
| 6 | + |
| 7 | +### Pipeline |
| 8 | + |
| 9 | +1. Build macOS app (`yarn tests:macos:build`, `SKIP_BUNDLING=1`) |
| 10 | +2. Start Firestore emulator |
| 11 | +3. Start Metro (`yarn tests:packager:jet-ci`) |
| 12 | +4. **Pre-fetch JS bundle** (workflow step) — must match the URL the app requests |
| 13 | +5. `yarn tests:macos:test-cover` — Jet `before` hook also prefetches, then `open` app |
| 14 | + |
| 15 | +### CI failure: bundle load hang / `Could not connect to development server` |
| 16 | + |
| 17 | +**Symptom** — Jet logs `[💻] macOS app started` but never `[🟩] Jet client connected`. System log / `syslog` artifact shows: |
| 18 | + |
| 19 | +``` |
| 20 | +HTTP load failed, 384/63910994 bytes (error code: -1017) |
| 21 | +Could not connect to development server. |
| 22 | +URL: http://localhost:8081/index.bundle?platform=macos&...&inlineSourceMap=false... |
| 23 | +``` |
| 24 | + |
| 25 | +**Cause** |
| 26 | + |
| 27 | +1. **Startup race** — `.jetrc.js` opened the app before Metro finished the first ~64MB bundle. The native HTTP client received a truncated response (`-1017`) and JS never loaded, so mocha-remote never connected. |
| 28 | +2. **Prefetch URL mismatch** — CI warmed `inlineSourceMap=true` without `lazy` / `app=` query params, while the default `AppDelegate` requested `localhost` with `inlineSourceMap=false` — a cache miss and a second full bundle build at app launch. |
| 29 | +3. **`localhost` vs `127.0.0.1`** — same class of issue as [iOS AppDelegate](ios.md#operational-notes); macOS can connect via `::1` while Metro is still streaming. |
| 30 | + |
| 31 | +**Mitigations in this repo** |
| 32 | + |
| 33 | +| Change | Location | |
| 34 | +|--------|----------| |
| 35 | +| `127.0.0.1` + explicit `inlineSourceMap:YES` bundle URL (mirrors iOS) | `tests/macos/io.invertase.testing-macOS/AppDelegate.mm` | |
| 36 | +| `waitForMetroMacosBundle()` before `open` app | `tests/.jetrc.js` → `macos.before` | |
| 37 | +| CI prefetch uses **exact** bundle query string (127.0.0.1, `lazy`, `inlineSourceMap=true`, `app=`) | `.github/workflows/tests_e2e_other.yml` | |
| 38 | + |
| 39 | +**Diagnosing** |
| 40 | + |
| 41 | +```bash |
| 42 | +rg 'Could not connect to development server|HTTP load failed|Jet client connected|macOS Metro bundle prefetched' detox-step.log syslog.log |
| 43 | +log show --predicate 'process == "io.invertase.testing"' --last 10m --style compact | rg 'development server|HTTP load failed' |
| 44 | +``` |
| 45 | + |
| 46 | +### CI failure: `tryDeserialize is not a function` (mocha-remote-server patch) |
| 47 | + |
| 48 | +**Symptom** — immediate crash on first WS message after client connects: |
| 49 | + |
| 50 | +``` |
| 51 | +TypeError: (0 , serialization_1.tryDeserialize) is not a function |
| 52 | + at Server.handleMessage (.../mocha-remote-server/dist/Server.js:149) |
| 53 | +``` |
| 54 | + |
| 55 | +**Cause** — `Server.js` patch called `tryDeserialize` but the helper was never added to `dist/serialization.js`. |
| 56 | + |
| 57 | +**Fix** — export `tryDeserialize` from `serialization.js` in `.yarn/patches/mocha-remote-server-npm-1.13.2-*.patch`; run `yarn patch-commit` + `yarn install` so `yarn.lock` hash updates. |
| 58 | + |
| 59 | +### Related |
| 60 | + |
| 61 | +- [iOS CI](ios.md) — simulator + Detox; shared Jet / mocha-remote patches |
| 62 | +- [Coverage design](../testing/coverage-design.md) — macOS uploads `e2e-ts-macos` only (no native gate) |
| 63 | + |
| 64 | +## Windows / shared |
| 65 | + |
| 66 | +TBD — Windows workflows and shared actions (caches, Codecov, etc.). |
0 commit comments