fix(cli): keep desktop targets out of the CI jobs e2e init writes
What
e2e init --ci github-actions (or gitlab) makes no job for a desktop target. The web job then names its own targets with --target, and init warns which desktop targets no job runs.
Why
On main, a config with a web target and a desktop target got one Ubuntu web job that ran every target. The desktop target stops there with UNSUPPORTED_CAPABILITY on every run: the desktop engine drives macOS apps only, and it needs Accessibility permission, which a hosted runner cannot grant. Main already leaves Electron targets out this way, so desktop targets now go through the same path.
How it works
NO_JOBinpackages/e2e/src/cli/init/ci.tsholdsmacosbesideelectron.ciJobskeeps those targets out of every job. The web job names its targets once any target is left out, soe2e run --target sitedoes not pick up the desktop target.writePipelineinpackages/e2e/src/cli/init.tswarns once per left-out platform, each with its own reason and docs link. On main, the one warning said "an Electron app needs a display" for any target left out.- When an existing config does not load,
writePipelinefalls back to package.json. A project that depends on@e2e-dev/desktopnow gets no pipeline there, as one with the mobile or Electron engine does, since one web job would run the desktop target. docs/reference/cli.mdx("CI pipeline") says desktop and Electron targets get no job, and thatinitnames them.
Verified
Ran it locally: yes
Scratch project with its own git root, e2e, @e2e-dev/web, and @e2e-dev/desktop linked from the built packages, and an existing e2e.config.ts with a web() target site and a desktop() target mac. I ran CI=1 e2e init --yes --ci github-actions --gateway none once with main's build and once with this branch's:
| main | this PR | |
|---|---|---|
run: line in .github/workflows/e2e.yml | npx e2e run --reporter list,junit (the Ubuntu job runs mac too) | npx e2e run --target site --reporter list,junit |
| Warning | none | No CI job runs mac: a desktop app needs a Mac with Accessibility permission, which a hosted runner can't grant; see https://e2e.com/docs/desktop |
The two new unit tests (init-ci.test.ts for ciJobs, cli-init.test.ts for the workflow and the warning) fail with macos taken out of NO_JOB, and pass with it.
🤖 Generated with Claude Code
Summary by CodeRabbit
-
Bug Fixes
e2e init --cino longer creates jobs for macOS desktop targets, which require Mac runners with Accessibility permission. Web targets continue to run in the web job.- When targets are omitted from generated pipelines, the CLI now reports platform-specific reasons, including for macOS and Electron.
-
Documentation
- Clarified which targets receive CI jobs and why desktop and Electron targets are omitted.