Skip to content

chore(frontend): e2e가 다른 작업 트리의 서버를 재사용하지 않게 수정 - #196

Merged
sunwoo162 merged 2 commits into
developfrom
sunwoo162/e2e-port-isolation
Nov 28, 2026
Merged

sunwoo162 merged 2 commits into
developfrom
sunwoo162/e2e-port-isolation

Conversation

@sunwoo162

Copy link
Copy Markdown
Collaborator

문제

playwright.config.ts가 CI가 아니면 reuseExistingServer: true였습니다. 그래서 로컬에서 4173 포트에 다른 worktree나 이전 빌드의 서버가 떠 있으면, 이 트리가 아닌 다른 빌드를 검사하고도 통과나 실패를 보고했습니다. 페이지 분해 작업(#192~#195)을 여러 worktree에서 동시에 검증하다가 실제로 겪은 문제입니다. CI는 CI=true라 영향이 없었습니다.

수정

  • 기본은 항상 새로 빌드해 띄웁니다.
  • E2E_PORT로 포트를 바꿀 수 있습니다(동시 실행용).
  • 같은 트리에서 반복 실행할 때만 E2E_REUSE_SERVER=1로 재사용합니다.
  • README의 개발 검사 절에 사용법과 visual-change 라벨을 적었습니다.

확인

  • E2E_PORT=4190 npx playwright test e2e/routes.e2e.ts 통과
  • npm run check 통과

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
gsmsv-client-v2 Ready Ready Preview Nov 28, 2026 4:18pm UTC
gsmsv-client-v2-main Ready Ready Preview Nov 28, 2026 4:18pm UTC

@sandrone-code-review

sandrone-code-review Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Pull Request 요약

e2e 테스트에서 서버 재사용과 포트 설정을 환경 변수 기반으로 관리하도록 목적을 변경했습니다. README.md에 재사용 및 포트 설정 사용법을 추가하고, playwright.config.ts와 포트 파싱 로직을 수정하여 환경 변수에 따라 서버를 재사용하거나 새로 시작하도록 구현했습니다.

파일 변경 내용
README.md e2e 기본 서버 재사용 정책 및 포트 환경 변수 사용법을 문서에 추가했습니다.
playwright.config.ts 포트 값을 Number()로 변환하고, 재사용 플래그를 E2E_REUSE_SERVER 변수로 제어하도록 수정했습니다.

복수 모델 · 입력 9,786 · 출력 1,781 · 합계 11,567 토큰

Comment thread playwright.config.ts Outdated

const port = 4173;
// 여러 worktree에서 동시에 돌려도 서로의 서버를 쓰지 않도록 포트를 바꿀 수 있다(E2E_PORT).
const port = Number(process.env.E2E_PORT ?? 4173);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중요 포트 파싱 시 NaN 발생 가능

process.env.E2E_PORT가 숫자가 아닌 문자열일 경우 Number()는 NaN를 반환하고, ?? 연산자는 undefined만 처리하므로 NaN가 그대로 사용되어 서버 시작 시 포트 오류가 발생합니다.

제안:

const port = Number(process.env.E2E_PORT) || 4173;

복수 모델

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7ab8f56에서 반영했습니다. 빈 값은 기본 4173을 쓰고, 숫자가 아니거나 범위를 벗어난 값은 기본 포트로 조용히 바꾸지 않고 설정 단계에서 오류를 냅니다. 잘못 적은 포트 때문에 엉뚱한 서버를 검사하는 일이 없게 하려는 것입니다.

sunwoo162 and others added 2 commits November 29, 2026 01:18
로컬에서 4173 포트에 이미 떠 있는 서버를 재사용해, 다른 worktree의 빌드를 검사하는 일이 있었다.
기본은 항상 새로 빌드해 띄우고, E2E_PORT로 포트를 바꾸고 E2E_REUSE_SERVER=1일 때만 재사용한다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sunwoo162
sunwoo162 force-pushed the sunwoo162/e2e-port-isolation branch from 827ad06 to 7ab8f56 Compare November 28, 2026 16:18
@sunwoo162
sunwoo162 merged commit 0c9b264 into develop Nov 28, 2026
6 checks passed
@sunwoo162
sunwoo162 deleted the sunwoo162/e2e-port-isolation branch November 28, 2026 16:22
sunwoo162 added a commit that referenced this pull request Nov 29, 2026
Co-authored-by: sunwoo162 <205418898+sunwoo162@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant