fix(cli): keep desktop targets out of the CI jobs e2e init writes

Closed
KD
7h ago
+42-9

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

  1. NO_JOB in packages/e2e/src/cli/init/ci.ts holds macos beside electron. ciJobs keeps those targets out of every job. The web job names its targets once any target is left out, so e2e run --target site does not pick up the desktop target.
  2. writePipeline in packages/e2e/src/cli/init.ts warns 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.
  3. When an existing config does not load, writePipeline falls back to package.json. A project that depends on @e2e-dev/desktop now gets no pipeline there, as one with the mobile or Electron engine does, since one web job would run the desktop target.
  4. docs/reference/cli.mdx ("CI pipeline") says desktop and Electron targets get no job, and that init names 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:

mainthis PR
run: line in .github/workflows/e2e.ymlnpx e2e run --reporter list,junit (the Ubuntu job runs mac too)npx e2e run --target site --reporter list,junit
WarningnoneNo 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 --ci no 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.