ReviewOS

also looking at this

loghqorg/loghq

test(e2e): isolate mutating runs and account cleanup

#12
Merged glennmichael123 wants to merge test/loghq-e2e-safety into main
4 files +209 -27
tests/e2e/README.mdadded+29-0
Changes to tests/e2e/README.md
@@ -0,0 +1,29 @@
1# Local E2E safety
2
3These mutating HTTP suites are disabled by default. A reachable development server
4does not opt a normal unit-test run into account creation or database cleanup.
5
6An intentional run requires all three variables:
7
8- `E2E_RUN=1`
9- `E2E_BASE_URL`: an HTTP numeric-loopback origin with an explicit port, such as
10 `http://127.0.0.1:3100`. Remote hosts, redirects and URL credentials are not allowed.
11- `E2E_SQLITE_PATH`: an absolute path to an existing `database.sqlite` inside a
12 freshly created `loghq-e2e-*` directory directly under the system temp directory.
13
14Start a separate local application instance using that same disposable database.
15Do not point the test instance at real data. Disable outbound mail, notifications,
16webhooks and paid integrations in that instance before running these suites.
17The URL guard cannot prove which database or integrations a local server uses;
18the operator must configure the isolated server correctly.
19
20Cleanup opens only the explicitly named disposable SQLite file and only removes
21accounts whose exact email addresses were generated in this process. It never
22uses the application's default database connection or a wildcard email match.
23
24## Known coverage gap
25
26The auth and routing suites still contain expectations for the previous page-action
27login and readable `loghq_token` cookie. They need migration to the current JSON
28auth endpoints and HttpOnly `auth-token` contract before they can serve as a current
29auth release gate. This safety guard does not claim those legacy expectations pass.