[PR #286·289·290·291] Running Separately Tested Features in One Line on the Real Server
Detail 4 (quests, routines, head office review) was built in small tasks, and each task was tested on its own. These four PRs ran those separately built features in one line on the real server, and matched the code to a design document from head office that arrived in the meantime. In order: the customer app integration test (PR 286), the server flow test (PR 289), applying items 1–3 of head office’s design document (PR 290), and the admin web flow tests (PR 291).
The models differ by PR. All ran on my Windows computer.
- PR 286: The customer app lead session (Claude Opus 5.5) did the tests, docs, and PR. This was a task the lead session writes itself, so Codex was not used. Decisions outside the plan were made by the Detail 4 development lead session (a session that hands work out to several task sessions, Claude Opus 5.5).
- PR 289: The server track session (Claude Opus 5.5) did the work order, verification, docs, and PR, and Codex (
gpt-6.1-terra) wrote the test. The final review (codex exec review) was also done by Codex. - PR 290: A Claude session (Claude Opus 5.5) did the work order, tests, review, and docs, and Codex (
gpt-6.1-terra) did the implementation and final review. The plan draft was written by the lead session (Claude Opus 5.5). - PR 291: The admin web track session (Claude Opus 5.5) did the flow tests, work order, verification, docs, and PR, and Codex (
gpt-6.1-terra) wrote the history screen fix. The approach of logging in only once was chosen by the lead session (Claude Opus 5.5).
| PR | What was done | Who wrote it | Result |
|---|---|---|---|
| 286 | Connect the customer app’s request functions to the real server | Claude (tests) | Four integration test files, 19 passing |
| 289 | One server flow as a single test | Codex (test) | Passed from the start, no implementation changes |
| 290 | Fix items 1–3 that differed from head office’s design document | Claude (tests), Codex (implementation) | New tests failed first, then passed |
| 291 | Four admin web flows (Playwright) | Claude (tests), Codex (history screen) | All 15 flow tests passed twice |
PR 286: Connecting the customer app to the real server
What was done and why
To see whether the Detail 4 customer app (today’s tasks, doing a task) works against the real server rather than fake responses (server answers the tests decide in advance), Claude wrote an integration test (a test that calls the real server and database through the app’s request functions). There are three tests.
- Without start information, both the quest and routine tabs show “no start information.” Once the admin enters start information, the routine tab shows 4 routines, and only the quest tab shows “task list in preparation,” because no quest version has been approved.
- Task actions are tried in turn on a routine. After completing one, sending again with the same request number returns the same result and leaves one history row. Sending the same number with only the memo changed is refused with 409 (request conflict). An abnormal report becomes “under head office review” and can’t be undone. Skipping, undoing, and the progress count are checked too.
- When the admin approves the draft version through the real approval request, the quest tab of a module that started today shows the start-day quests, and completing one brings the progress count to 1.
One test-only request (8 lines) was added to the test server. It only inserts the quest draft version and 4 routines; it doesn’t approve anything. This request exists only in the test code, not in the real server.
Where the plan got it wrong
The implementation plan said this task could start “after server tasks 5 and 8 are merged.” But the “admin approval” in the test flow needed server task 6 (the admin request that approves a quest version). When the plan was written, the server task holding the approval request was misidentified. As the lead session decided, the parts before approval (tests 1 and 2) were written first, and the quest flow was left as a “todo test” (a placeholder for a test not yet written). After server task 6 (PR 285) was merged, it was filled in with the real approval request.
What was chosen, and what was dropped
| Chosen | Dropped alternative | Why it was dropped |
|---|---|---|
| Approve through the real admin request | Flip the database value to “approved” in the test-only request | It skips the pinning and audit path, so the test no longer matches reality |
| Run the quest test on a module started today | A module started 10 days ago, like the earlier test | The test would depend on whether the draft has a quest for that day |
- Approve through the real admin request: On approval, the server pins the version to cycles (one operating period from start to end) and writes an audit record (a record of who did what and when).
- Dropped alternative — flipping the database value to “approved” in the test-only request: it skips the pinning and audit path, so the test no longer matches reality.
- The approval test goes last: Approval pins the version to every planned or active cycle. It was put last so it doesn’t disturb the earlier “no approved version” test.
- The quest test uses a module that started today: The draft has several start-day (day 0) quests, so tasks are sure to appear today.
- Dropped alternative — a module started 10 days ago, like the earlier test: the test would depend on whether the draft happens to have a quest for that day.
- This test gets its own site. Routine tasks are per site, so it was kept from mixing with other tests.
How it was checked
- The four customer app integration test files (including Details 2, 3, and 4) were run together, and all 19 tests passed (21 s). Detail 4 alone was run once more, and its 3 tests passed.
- The app type check passed.
- Full
npm run verify: passed, according to the PR description (it took longer than usual because it overlapped with another session’s verification).
PR 289: One server flow as a single test
What was done and why
This was the last task in the Detail 4 server plan. To see whether features tested one task at a time still work when joined in one line, the plan’s single flow was made into one test. The flow:
- After the quest draft is inserted, the customer sees “task list in preparation” before approval.
- Once the admin approves and a cycle is created from the planned start date, only quests appear; entering the start date adds 4 routines.
- Even with lookups and the scheduled run overlapping around midnight Korean time, tasks are created only once a day.
- Skipping three days creates all the quests for the days in between, but only today’s routines, and past routines are closed as “no record.”
- Saving readings and input records leaves tasks unchanged. A different body under the same request number is refused with 409 for both task actions and input records.
- Abnormal report → head office asks for a recheck (the customer sees head office’s answer but not its internal memo) → abnormal again → confirmed → progress count.
- After a new version is approved, running cycles still show the old text; after “move to the new version,” tasks already created stay as they are, and the new text appears from the next day.
What was chosen, and what was dropped
| Chosen | Dropped alternative | Why it was dropped |
|---|---|---|
| One flow as a single test | A test per step | Each step builds on the state before it |
- Not shaken by rules another session was changing: That same day, another session (PR 290) was changing two rules: the denominator of the progress count, and a required memo for abnormal reports. The server track session wrote these into the work order, so the test always includes a memo when reporting abnormal, and checks the progress count with no skipped tasks. It passes under both the current and the new version of each rule. It doesn’t compare whole responses, so an added field in the response won’t break it.
- Following the code over the work order: The work order named the wrong request for creating a planned cycle. Codex created it with the right request, as the code actually works, and since that matches the code it was left as is.
- Checking the move: In the new version, one item’s base date is changed, to see that the new text appears the day after the move. A different item is used to confirm that changed text doesn’t appear in running cycles.
- Dropped alternative — splitting the flow into a test per step: each step builds on the state before it, so it stays as one.
How it was checked
- The test passed from the start. That means nothing was missing in the implementation, so the implementation wasn’t changed. This test alone was run three times and passed each time (about 15–23 s).
- Full
npm run verify: 848 s, passed. codex exec review: no findings. Codex has no Docker (the tool that starts the test database), so it couldn’t run the flow test and checked only build, types, and lint.
PR 290: Fixing items 1–3 that differed from head office’s design document
What was done and why
That same day, head office sent its design document for quests and routines. A review session compared it with the current code and found 7 differences, and I decided to fix only the easy items 1–3 now.
- The progress count’s denominator: Skipped tasks stay in the denominator, and “n skipped” is shown separately. Only tasks skipped as “not applicable” are left out.
- A required memo for abnormal reports: Reporting abnormal must include a memo. Whitespace alone isn’t enough.
- Home screen wording: “All of today’s tasks are done” isn’t shown while skipped tasks or abnormal reports under head office review remain.
What was chosen, and what was dropped
| Chosen | Dropped alternative | Why it was dropped |
|---|---|---|
| Read the skip reason from the last customer action | Add a field to the task table | It needs a migration |
| Check the memo on the server; the app sends it as typed | Trim leading and trailing spaces before sending | Memos have always been sent untouched, and it would affect the same-request-number body comparison |
- Reading the skip reason from the last customer action: The skip reason lives only in the task action history table.
- Dropped alternative — adding a field to the task table: it needs a migration (a file that changes the database structure).
- Instead the reason is read from the “last customer action” the response already carries. The skipped state only comes from a customer’s skip, so the last customer action is that skip.
- Checking the memo on the server: The server refuses it while checking the request body; the app only disables the button and sends the memo exactly as typed.
- Dropped alternative — trimming leading and trailing spaces before sending: memos have always been sent untouched, and it would affect the same-request-number body comparison.
- The home “n skipped” line shows even while tasks remain, the same way as the “n under head office review” line next to it.
- A review finding not applied:
codex exec reviewpointed to “resending an abnormal report without a memo that was received before deployment.” Detail 4 isn’t deployed yet, so no such requests exist; it wasn’t applied, and the reason was written in the PR.
How it was checked
- In the commit holding only tests, the new tests were seen failing first (10 in the app, 1 server rule, 2 server flow).
- After the implementation, 47 server-side tests, 115 app-side tests, and 3 real-server integration tests passed.
- Full
npm run verify: 490 s, passed. At one point another verification was running at the same time and the time limit was exceeded; that was two verifications overlapping, not a test failure. - PR 289 merged first; after merging main in, PR 289’s server flow test, the server and app tests, the integration tests, and the full type check were run again and passed.
PR 291: Admin web flow tests
What was done and why
The Detail 4 admin web screens were run end to end against the real server (a server with a test database started) instead of fake responses. Four flows were written with Playwright (a test tool that clicks through a browser automatically).
- Approve the quest draft on the admin screen → cycle → the customer (via server request) reports a routine as “abnormal” → it shows in the admin review list → ask for a recheck → the customer reports abnormal again → confirm (answer and head office memo) → the customer’s response has the answer but not the head office memo.
- Renaming a routine leaves “routine saved” in the list and the history screen.
- A cycle without a planned end date shows a warning that the tasks tied to that date can’t be created.
- A head office quest created for today shows in the customer’s quest tab, and disappears when cancelled.
What was chosen, and what was dropped
| Chosen | Dropped alternative | Why it was dropped |
|---|---|---|
| Log in as admin once and save that state (option A) | Raise the test server’s login limit (option B) | It touches a security safeguard and could affect other tests using the same test server |
| Log in as admin once and save that state (option A) | Wait a minute between tests | Slow and unreliable |
- Sites, modules, and customers are created fresh for each test through admin requests. No extra data has to be added to the test server, and nothing mixes with other test files’ data. On the customer side, server requests are called directly instead of the customer app (as in Detail 3).
- Abnormal reports always include a memo, because PR 290 makes the server refuse abnormal reports with an empty memo (as the lead session advised).
- Flow 2 found a gap in the history screen. The history screen showed the “routine saved” action under its raw English name, and the detail field showed the routine’s entire data as is. Claude first wrote 10 unit tests for the Korean names of Detail 4’s 7 actions and for the routine-saved detail (“old name → new name”), then handed the implementation to Codex.
- The admin logs in only once (option A). The server accepts at most 10 admin logins per minute from one IP. Even before this PR, the whole admin web flow test run logged in exactly 10 times within a minute. When Detail 4 added just one more, the last test file — an unrelated one — failed with “too many requests” (429). So a setup step now logs in once and saves the login state, and every test starts from it. If the saved login is missing or has expired, it fails with a clear message instead of quietly logging in again. Only the one test that checks login itself logs in directly.
- Dropped option B — raising the test server’s login limit: the change is small, but it touches a security safeguard and could affect other tests using the same test server, so the lead session chose A.
- Dropped alternative — waiting a minute between tests: slow and unreliable.
How it was checked
- Flows 1, 3, and 4 passed from the start; flow 2 failed because of the history screen. After the 10 unit tests were seen failing, Codex’s fix made 38 history tests pass.
- After sharing the login, the full
npm run e2e(all admin web flow tests) was run twice in a row, passing 15 each time (93 s, 65 s), with no 429. Admin login requests per run went from 10 to 2. - Full
npm run verify: 861 s, passed. After merging main, the history tests and the full flow tests were run twice more and passed.
Lessons
- Features that pass on their own still need to be joined in one line. The server flow passed from the start, confirming nothing was missing in the implementation, and the admin web flows found a gap in the history screen.
- Make tests go down the same path as reality. Flipping approval in the database skips the pinning and audit record. Use the real request, and put any step that would disturb other tests at the end.
- Write a plan’s “when can this start” by checking which task creates each request. It was missed that the approval request lived in a different server task.
- Don’t let tests lean on rules another session is changing. Instead of comparing whole responses, the test avoided the changing conditions so it passes under both versions.
- A test suite running right at a shared limit breaks in an unrelated file when just one test is added. Don’t look only at the failing file; count the 429s in the server log first.
- In a commit holding only tests, a failing type check is normal, because the tests use a field the shared type doesn’t have yet. Adding a required field to a shared type means fixing every test fixture that uses that type as well.