diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3a02cb..4bf9d2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,14 +56,12 @@ jobs: - name: Unit Test run: pnpm run test:unit - # ======== E2E: Windows + macOS ======== - # Windows and macOS are the platforms users run the extension on. Linux E2E - # is deliberately not run here: rstack-ecosystem-ci runs the suites on - # ubuntu-latest (rstackjs/rstack-editor#40), and for that `e2e/run.mjs` - # re-execs under `xvfb-run` when DISPLAY is unset. The old concern that - # non-atomic fixture writes race inotify on Linux was tested and did not - # reproduce (rstackjs/rstack-editor#67), so the exclusion is about CI cost, - # not correctness. + # ======== E2E: Windows + Ubuntu (PR), Windows + macOS (push main) ======== + # Pull requests run ubuntu-latest instead of macos-latest to avoid long macOS + # runner queues while still covering POSIX + Windows (`e2e/run.mjs` re-execs + # under `xvfb-run` on Linux when DISPLAY is unset; the old inotify concern + # did not reproduce in rstackjs/rstack-editor#67). Pushes to `main` keep + # macos-latest + windows-latest so macOS-specific regressions are still caught. e2e: name: E2E (${{ matrix.os }}) runs-on: ${{ matrix.os }} @@ -71,7 +69,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, macos-latest] + os: ${{ github.event_name == 'push' && fromJSON('["windows-latest", "macos-latest"]') || fromJSON('["windows-latest", "ubuntu-latest"]') }} steps: - name: Checkout diff --git a/packages/vscode/AGENTS.md b/packages/vscode/AGENTS.md index a2f98af..9c9f69e 100644 --- a/packages/vscode/AGENTS.md +++ b/packages/vscode/AGENTS.md @@ -77,6 +77,6 @@ One extension replacing the standalone `rstack.rslint` and `rstack.rstest` exten - E2E fixtures install exact versions of published npm packages (not workspace links): the extension must work against what users actually install. Renovate updates the exact toolchain pins; generated fixture lockfiles and `node_modules` remain disposable and uncommitted. - Prefer running the E2E slice that covers the change over the full chain: `pnpm test:e2e ` (or the `test:e2e:` aliases). Slices are declared in the `SLICES` table in `e2e/run.mjs` (name, fixtures, entry) — the package.json scripts are thin forwards and carry no slice knowledge. `RSTACK_LINT_E2E_SUITES=` filters lint suites. - Run E2E locally as `VSCODE_CLI=1 pnpm test:e2e `. Without it, the launched VS Code overwrites the extension host's `PATH` with a login-shell snapshot; on a machine whose login-shell `node` is below the runtime floor, the User Node preflight (correctly) refuses and every fmt test times out waiting for a server. CI is unaffected — its PATH `node` is new enough either way. The heavier alternative, `--force-disable-user-env` in `e2e/runTest.ts`, was deliberately not taken: it would change env fidelity for every slice. -- Linux E2E runs only in rstack-ecosystem-ci, which relies on `e2e/run.mjs` re-execing itself under `xvfb-run -a` when `DISPLAY` is unset (the whole chain runs against one X server, so `pnpm test:e2e` is the same command everywhere; `xvfb` is a prerequisite on Linux). This repo's CI runs E2E on Windows and macOS only, so the Linux path is not exercised here. +- Linux E2E relies on `e2e/run.mjs` re-execing itself under `xvfb-run -a` when `DISPLAY` is unset (the whole chain runs against one X server, so `pnpm test:e2e` is the same command everywhere; `xvfb` is a prerequisite on Linux). This repo's CI runs E2E on Windows and Ubuntu on pull requests and Windows and macOS on pushes to `main`. - `RSTACK_E2E_TOOLCHAIN_OVERRIDES="=,…"` packs each package into `/.toolchain/` and adds a `file:` override to every fixture's `pnpm-workspace.yaml`, so rstack-ecosystem-ci can run the suites against unreleased builds; setup fails if the lockfile still holds a registry version. Rslint needs two entries, `@rslint/core` and the host `@rslint/native-`: core resolves its binary through `require.resolve('@rslint/native-/bin')`, so overriding core alone would leave the published binary in place. The yaml is not restored — the env is for disposable checkouts; locally, `git checkout -- packages/vscode/e2e`. Rationale in the `setupFixtures.mjs` header. - `VSCODE_TEST_CACHE_PATH` moves the downloaded VS Code out of `.vscode-test/`; every `runTest.ts` entry forwards it to `@vscode/test-electron`. rstack-ecosystem-ci needs it because it runs `git clean -fdxq` in the checkout before each suite, which would wipe the cache. Unset keeps the default.