[PR #96~#97] Admin Web Flow Tests and a CI Job
This post bundles two PRs into one. PR #96 builds the flow tests, and PR #97 adds those tests to the automatic checks. I requested both. The completion time is when the last one, PR #97, was merged.
- What was done:
- PR #96: A test environment was built that runs the admin web end to end against a real server, a real database, and a browser. The browser is driven by Playwright (a tool that operates a browser automatically). The test server starts a test database, loads one admin, one facility, two modules, and one active customer, and then opens. Google sign-in was replaced with a fake verifier that recognizes only two fixed tokens.
- PR #97: The four flow tests from PR #96 had never run on a GitHub runner (the GitHub computer that runs automatic checks). The “CI passed” reported for PR #96 was a single
verifyjob, and these tests were not in it. So ane2ejob was added to the sameverify.yml.
- Chosen approach:
- Running the server: The server is compiled with
tscand run withnode. The server framework (Nest) needs marker information attached to the code, andtsxcannot produce it.tsxwas not installed either, and adding new packages was forbidden. - Screen-side setting: The proxy (the setting that forwards requests to the server) target port in the screen config is now read from the environment variable
E2E_SERVER_PORT. This went slightly beyond the range the instructions allowed, so it was raised as an owner-confirmation item. - CI job: No separate workflow file was created; the job was added to
verify.yml. It runs in parallel withverify, soverifydoes not get slower.continue-on-error, which hides failures, was not used. Compared with the example yaml in the work log, the action versions were matched to the@v7used inverify.yml, a 15-minute time limit was added, and the run-record (trace) folder was included in the files uploaded on failure.
- Running the server: The server is compiled with
- Checks:
- First run: Three of the four tests passed. The duplicate-number-change test failed because of a mistake in the test itself: its label lookup also matched a checkbox. It was sent back to the test author, who fixed it with an exact-match lookup, and then all four passed.
- Full check:
npm run verifypassed. It includes 412 server tests and does not include e2e.npm run e2etook about 46 seconds, including server compilation and the screen build. - PR #97: The
e2echeck in this PR’s CI passed (1 minute 36 seconds, checked withgh). The work log said whether it passed could not be confirmed when the PR was opened; the result after that was checked for this post.
| Item | Content |
|---|---|
| Bundled PRs | #96 build the flow tests, #97 add an e2e job to CI |
| Test environment | Real server and test database, automatic browser control, fake Google verifier |
| Flow tests | 4 passed, about 46 seconds per run |
| CI | e2e job added separately from verify, failures not hidden |
| Changed places | Test files, test server, settings, Playwright package, verify.yml (main server code unchanged) |
Who Did What
- I: Requested both works. For PR #97, I decided from when the
e2echeck counts as a check that must pass. - Claude (cloud session, Sonnet 5.5): Implemented the test environment.
- Fizz (GPT-6 Luna): Wrote the four tests and fixed the label lookup. It also did the backend and security review.
- Pollen (opencode/glm-5.3-flash-free): Did the general review. The result was approval.
- Claude (PL, Sonnet 5.5): Checked the changed scope and that CI passed. It also checked that no test was weakened or skipped and that there were no retries. The two findings Fizz raised were checked directly in the code.
- Claude (my Windows computer session, Sonnet 5.5): In PR #97, added the
e2ejob toverify.ymlunder.github. Only the owner may change that folder, so this session took it on at my request.
What Was Chosen and What Was Left
- Chosen: The tests build their environment on the test side only, without touching main server code. If
NODE_ENVis nottest, the test server exits immediately. - Decided: After PR #97 was merged,
e2ecounts as a check that must pass once it has passed three times in a row. This repository is private on a free plan, so GitHub’s “required checks” setting cannot be used; until then I decide by looking at the check. The decision was recorded in the rules document and the decision log. - Left: Fizz’s review raised two items, and neither was fixed. One is that the test server opens on all of
localhost(medium); the other is that the port value goes into an address without validation (low). The server only runs during tests and uses fake tokens and a temporary database, so the risk was judged small. Binding it to127.0.0.1only could break the proxy in environments wherelocalhostresolves to IPv6, so it was left as is. Any later decision on these two items and on the proxy port change is not in the work log, so it could not be confirmed.
What Could Not Be Verified
- In the cloud environment used for PR #96, the browser download failed, so a preinstalled browser was linked with a shortcut and run. This does not affect repository files.
- My Windows computer session, which made PR #97, did not run e2e directly. The first place it ran was the GitHub runner.
- Whether the
e2echeck keeps passing reliably is not yet known. Whether it has passed three times in a row is not in this record.
Lesson
Even when “CI passed”, look at which jobs actually ran. The pass for PR #96 did not include the newly built tests. When you add a new test, also check that it has been added to the automatic checks.