|
2 | 2 |
|
3 | 3 | ## Development |
4 | 4 |
|
5 | | -```bash |
| 5 | +```sh |
6 | 6 | bun install |
7 | | -bun run typecheck |
8 | | -bun run typecheck:e2e |
9 | | -bun run test |
10 | | -bun run build |
| 7 | +bun run check |
11 | 8 | ``` |
12 | 9 |
|
13 | | -The tests inject `fetch` implementations and do not call Gmail. |
| 10 | +`bun run check` runs typecheck, lint, format check and unit tests. `bun run format` rewrites the tree. |
| 11 | + |
| 12 | +Contributors sign the [CLA](CLA.md) on their first PR; the CLA bot explains how. |
| 13 | + |
| 14 | +Unit tests inject `fetch` and never call Gmail. `bun run test:e2e` runs the live |
| 15 | +suite, which skips unless `GMAIL_LIVE_TEST=1`. |
14 | 16 |
|
15 | 17 | ## Live Gmail checks |
16 | 18 |
|
17 | 19 | Use a dedicated Gmail fixture account and a Desktop OAuth client granted only |
18 | | -`gmail.modify`. The read smoke requires a query that matches exactly one |
19 | | -one-message thread: |
| 20 | +`gmail.modify`. The fixture query must match exactly one one-message thread: |
20 | 21 |
|
21 | | -```bash |
| 22 | +```sh |
22 | 23 | GMAIL_LIVE_TEST=1 \ |
23 | 24 | GMAIL_LIVE_CLIENT_ID='...' \ |
24 | 25 | GMAIL_LIVE_CLIENT_SECRET='...' \ |
25 | 26 | GMAIL_LIVE_FIXTURE_QUERY='subject:(interchange-gmail-e2e-fixture)' \ |
26 | 27 | bun run test:e2e |
27 | 28 | ``` |
28 | 29 |
|
29 | | -The full live suite has been verified against a dedicated Gmail fixture account. |
30 | | -It exercises every Gmail tool: |
31 | | - |
32 | | -- `gmail_search_threads` finds the one-message fixture thread. |
33 | | -- `gmail_get_thread` and `gmail_get_message` retrieve its metadata. |
34 | | -- `gmail_list_labels` lists the account labels. |
35 | | -- `gmail_create_draft` and `gmail_list_drafts` create and find a disposable |
36 | | - draft, which the suite then deletes. |
37 | | -- `gmail_label_message` and `gmail_unlabel_message` add and remove `STARRED` |
38 | | - on the fixture message. |
39 | | -- `gmail_label_thread` and `gmail_unlabel_thread` add and remove `STARRED` |
40 | | - on every message in the fixture thread. |
41 | | - |
42 | | -Add `GMAIL_LIVE_MUTATION_TEST=1` to run the draft and label checks. The suite |
43 | | -deletes its draft, restores the fixture labels, and never sends email. |
44 | | - |
45 | | -The first run opens Google OAuth and stores the refresh token in the ignored |
46 | | -`.local/gmail-live-token.json` file. Set `GMAIL_LIVE_TOKEN_FILE` when using a |
47 | | -different token file. Credentials and message contents are not logged. |
| 30 | +Add `GMAIL_LIVE_MUTATION_TEST=1` for the draft and label checks; the suite |
| 31 | +deletes its draft, restores the fixture labels and never sends email. The first |
| 32 | +run opens Google OAuth and stores the refresh token in the ignored |
| 33 | +`.local/gmail-live-token.json` (override with `GMAIL_LIVE_TOKEN_FILE`). |
48 | 34 |
|
49 | 35 | ## Commit messages |
50 | 36 |
|
|
0 commit comments