fix(repo): assign the E2E test server a dynamic port instead of 8010#229
Open
YusukeHirao wants to merge 2 commits into
Open
fix(repo): assign the E2E test server a dynamic port instead of 8010#229YusukeHirao wants to merge 2 commits into
YusukeHirao wants to merge 2 commits into
Conversation
Concurrent git worktrees/sessions running `yarn test` or the E2E suite collided on the fixed port 8010 with EADDRINUSE, or blocked until the earlier process released it. - test-server: `startServer` now binds to an OS-assigned port (`port = 0`) and threads the resolved port into the 7 routes that embed self-referencing "external" URLs via a lazily-read `PortRef` - global-setup.ts: shares the resolved port with test files through vitest's provide/inject channel (`testServerPort`) - Add `test-server-port.ts` exporting `TEST_SERVER_PORT` and origin constants for building test URLs - Update 27 e2e test files and the report-google-sheets API test to read the dynamic port instead of hardcoding 8010 - Add server.spec.ts proving two concurrent instances get different ports - Update ARCHITECTURE.md/CLAUDE.md/git skill docs to drop the stale fixed-port reference Closes #162
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test-server(E2E) to bind to an OS-assigned port instead of the fixed8010, so concurrent git worktrees/sessions runningyarn test/ the E2E suite no longer collide withEADDRINUSE.PortRef, and share it with test files through vitest's provide/inject channel (testServerPort).report-google-sheetsAPI test to read the dynamic port instead of hardcoding8010, via a newtest-server-port.tshelper (TEST_SERVER_PORT+ origin constants).server.spec.tsproving two concurrentstartServer()calls get different ports — the behavior issue テスト用サーバーが固定ポート8010を専有し、並行worktree/セッション間で競合する #162 is actually about.ARCHITECTURE.md/CLAUDE.md/ the git skill doc to drop the stale fixed-port reference.Closes #162
Test plan
yarn lint— 0 errors (41 pre-existing warnings, unrelated)yarn test— 479 test files / 3372 tests passed (includes the newserver.spec.ts)yarn vitest run --config vitest.e2e.config.ts— 29 test files / 136 tests passed, confirmed running on a dynamically-assigned port (not 8010) in the log output/code-review medium,/qa-engineer,/product-managerrun — findings addressed (shared origin constants added, cross-reference comment for the duplicatedProvidedContexttype augmentation, new concurrency-proving unit test)