[worker] Simplify tests (#3285)
# Why The worker integration tests were slow and required platform-specific CI runners (macOS for iOS, Linux for Android) because they attempted to build real React Native apps. This made the CI pipeline complex, slow, and resource-intensive. # How - **Replace full-build tests with fast mocked tests**: Instead of running actual Android/iOS builds, we now mock `@expo/build-tools` at the library boundary. This lets us test the worker's WebSocket communication, job dispatch, state sync, abort handling, and hanging worker detection without the overhead of real builds. - **Add new `jobExecution.test.ts`**: A new integration test that verifies the worker accepts jobs, executes them (via mocked builders), and returns success/error responses correctly. - **Update existing tests**: `abortBuild.test.ts`, `stateSync.test.ts`, and `possiblyHangingWorker.test.ts` now mock `@expo/build-tools` instead of the worker's internal `build.ts` module, allowing more of the real code path to execute. - **Simplify CI**: Consolidated the separate `worker-android-checks` and `worker-ios-checks` jobs into a single `worker-checks` job running on `ubuntu-latest`. Removed dependencies on `direnv`, `setup-gcloud`, and platform-specific scripts. - **Cleanup**: Deleted unused files including `__mocks__/build.ts`, macOS-specific Jest config, CI shell scripts, and the `direnv` internal action. The build-build part is going to be tested in system tests running in CI on `main`. # Test Plan cd packages/worker yarn test:integrationAll 19 tests pass in ~6 seconds (down from minutes with real builds). ```bash cd packages/worker yarn test:integration ``` All 19 tests pass in ~6 seconds (down from minutes with real builds).
S
Stanisław Chmiela committed
8ba877ab8103558bcb2bae2e22d8cf7ee193303a
Parent: 9f6e387
Committed by GitHub <noreply@github.com>
on 1/8/2026, 3:11:06 PM