Skip to content

Commit 3fecea3

Browse files
authored
docs: Rename CLAUDE.md to AGENTS.md and update e2e guidance (#1453)
1 parent 2f9553a commit 3fecea3

2 files changed

Lines changed: 28 additions & 25 deletions

File tree

‎AGENTS.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Agent guidance for sentry-electron
2+
3+
## Running the e2e tests
4+
5+
The end-to-end tests in [`test/e2e`](./test/e2e) launch real Electron apps. A few things are required to run them
6+
successfully, especially from an agent shell such as Claude Code:
7+
8+
- **`unset ELECTRON_RUN_AS_NODE` first.** Some agent shells, such as Claude Code, export `ELECTRON_RUN_AS_NODE=1`,
9+
which makes every Electron binary run as plain Node. When that happens `require('electron').app` is `undefined` and
10+
every test crashes at SDK load (`normalize.js` calling `app.getAppPath()`) or times out. This is not a broken
11+
harness — it only affects shells where that variable is set.
12+
- **Set `ELECTRON_VERSION`.** The runner throws `ELECTRON_VERSION is not set` otherwise. The SDK needs Electron 35 or
13+
higher, so use a version in that range whose binary is already cached (e.g. `39.8.10`).
14+
- **Build and pack the SDK first.** The test apps install `sentry-electron-v<version>.tgz` from the repo root, and
15+
`yarn e2e` does not create it. Run `yarn build && yarn pack` after each change to `src`.
16+
- **Use `yarn e2e`, not a bare `vitest` invocation.** `yarn e2e` runs the `pree2e` step (`set-version`, cache cleanup)
17+
that the tests depend on.
18+
- **`-t` is a regex**, so escape parentheses in test names, e.g. `-t 'Browser Tracing \(Span streaming\)'`.
19+
- **`DEBUG=true`** prints every received envelope as `[Test Runner] Received event ...`, which is the easiest way to
20+
build/verify assertions.
21+
22+
Example — run all span-streaming tests against Electron 39.8.10:
23+
24+
```shell
25+
unset ELECTRON_RUN_AS_NODE
26+
yarn build && yarn pack
27+
DEBUG=true ELECTRON_VERSION=39.8.10 yarn e2e -t 'Span streaming'
28+
```

‎CLAUDE.md‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)