Skip to content

test: 통합 테스트 수정 - 타입 및 시간 제한 개선#27

Open
wlgns5376 wants to merge 6 commits intomainfrom
bug/v1.0.2
Open

test: 통합 테스트 수정 - 타입 및 시간 제한 개선#27
wlgns5376 wants to merge 6 commits intomainfrom
bug/v1.0.2

Conversation

@wlgns5376
Copy link
Owner

Summary

  • end-to-end-system.test.ts에서 피드백 처리 시간 제한을 15250ms로 조정하여 테스트 안정성 향상
  • task-reassignment.test.ts에서 Logger 타입 및 초기화 방식 개선
  • WorkspaceManager 설정에 필요한 타입 명시로 타입 안정성 확보

Test plan

  • 수정된 통합 테스트 실행하여 정상 동작 확인
  • 타입 체크 통과 확인
  • 기존 테스트들이 여전히 통과하는지 확인

🤖 Generated with Claude Code

wlgns5376 and others added 6 commits August 23, 2025 14:52
- TaskRequestHandler 생성자에서 getWorkspaceManager() 호출 오류 수정
- MockWorkerPoolManagerBuilder에 기본 WorkspaceManager mock 객체 반환 구현
- app-merge-workflow.test.ts 테스트 정상화

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Git worktree 유효성 검증 로직 개선
- .git 파일의 존재와 내용을 엄격히 검증하도록 수정
- 디렉토리만 존재하는 경우 유효하지 않은 것으로 판단
- 테스트 통과를 위한 정확한 워크트리 검증 구현

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- WorkspaceManagerInterface에 필수 메서드 isWorktreeValid 누락으로 발생한 테스트 실패 수정
- TypeScript 타입 오류 수정 (WorkerType 명시적 타입 지정)
- 모든 테스트 케이스 통과 확인

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Worker.assignTask 메서드에서 로그에 previousStatus 필드가 추가되어
테스트 기댓값을 업데이트했습니다.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
WorkerPoolManager.assignWorkerTask에서 RESUME_TASK 액션에 대해
IDLE 상태도 허용하도록 수정했습니다. 이는 Worker 클래스의
assignTask 메서드 구현과 일치시키기 위함입니다.

기존 workspace가 존재하는 경우 idle Worker에 RESUME_TASK를
할당할 수 있게 되어 통합 테스트가 통과합니다.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- end-to-end-system.test.ts에서 피드백 처리 시간 제한을 15250ms로 조정
- task-reassignment.test.ts에서 타입 import 및 설정 수정
  - Logger 타입 및 초기화 방식 개선
  - WorkspaceManager 설정 타입 명시
  - 테스트에서 유효한 worktree 생성 로직 개선

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @wlgns5376, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 통합 테스트의 안정성과 타입 안전성을 향상시키는 데 중점을 둡니다. 작업자 상태 관리 로직을 개선하고, Git 워크트리 유효성 검사를 강화하며, 테스트 인프라를 업데이트하여 더 견고하고 예측 가능한 테스트 환경을 구축합니다.

Highlights

  • 작업자 상태 관리 개선: WorkerPoolManager에서 RESUME, FEEDBACK, MERGE 작업에 대한 작업자 상태 전환 로직을 개선했습니다.
  • Git 워크트리 유효성 검사 강화: WorkspaceManager에서 Git 워크트리 유효성 검사를 강화하여 유효한 워크트리만 인식하도록 했습니다.
  • 통합 테스트 인프라 개선: task-reassignment.test.ts 통합 테스트 스위트를 개선하여 Logger 구성 업데이트, 관리자 구성에 대한 명시적 타입 정의, 개발자 서비스의 포괄적인 mocking을 포함했습니다.
  • 테스트 시간 제한 조정: end-to-end-system.test.ts에서 테스트 안정성을 높이기 위해 피드백 처리 시간 제한을 조정했습니다.
  • 테스트 정리 절차 개선: fs.rm과 force: true를 사용하여 테스트 정리 절차를 개선했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 통합 테스트의 타입 안정성을 높이고 타임아웃을 조정하여 전반적인 테스트 품질을 개선했습니다. 특히 WorkspaceManager의 유효성 검사 로직을 강화하고 관련 테스트를 수정한 점이 인상적입니다. 코드의 정확성과 안정성을 높이는 좋은 변경이라고 생각합니다. 몇 가지 테스트 코드의 가독성과 유지보수성을 더 향상시킬 수 있는 제안 사항을 코멘트로 남겼습니다.

Comment on lines +146 to +152
this.methods.set('getWorkspaceManager', jest.fn(() => ({
// 기본 WorkspaceManager mock
getWorkerWorkspace: jest.fn(),
checkWorkspaceExists: jest.fn(),
createWorkerWorkspace: jest.fn(),
removeWorkerWorkspace: jest.fn()
})));

Choose a reason for hiding this comment

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

medium

getWorkspaceManager의 모의(mock) 구현이 WorkspaceManagerInterface와 일치하지 않습니다. 현재 모의 구현된 getWorkerWorkspace, checkWorkspaceExists 등은 인터페이스에 존재하지 않는 메서드입니다. 이로 인해 테스트가 의도와 다르게 동작하거나 혼란을 줄 수 있습니다. WorkspaceManagerInterface에 정의된 메서드들(예: createWorkspace, isWorktreeValid 등)을 모의 구현하도록 수정하는 것이 좋습니다.

    this.methods.set('getWorkspaceManager', jest.fn(() => ({
      // WorkspaceManagerInterface에 맞는 기본 mock
      createWorkspace: jest.fn(),
      setupWorktree: jest.fn(),
      setupClaudeLocal: jest.fn(),
      cleanupWorkspace: jest.fn(),
      getWorkspaceInfo: jest.fn(),
      isWorktreeValid: jest.fn(),
    })));


const mockDeveloperFactory = {
create: jest.fn().mockReturnValue(mockDeveloper)
} as any;

Choose a reason for hiding this comment

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

medium

mockDeveloperFactoryas any로 타입 캐스팅하면 타입 검사를 무력화하여 잠재적인 오류를 숨길 수 있습니다. as any는 가급적 피하는 것이 좋습니다. WorkerPoolManager의 의존성 주입 시 developerFactory의 타입을 typeof DeveloperFactory 대신 create 메서드를 가진 객체 인터페이스로 변경하면 as any 없이도 타입 안전성을 확보할 수 있을 것입니다. 불가피하게 사용해야 한다면, 그 이유를 주석으로 남겨두는 것을 권장합니다.

Comment on lines +242 to +245
const availableWorker = await workerPoolManager.getAvailableWorker();
if (!availableWorker) {
throw new Error('No available worker found for reassignment test');
}

Choose a reason for hiding this comment

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

medium

테스트 코드에 "Debug:" 주석과 함께 throw new Error(...)를 사용한 검증 로직이 남아있습니다. 이 코드는 디버깅 목적으로 추가된 것으로 보이며, 최종 코드에서는 Jest의 expect와 같은 표준 단언(assertion)으로 대체하거나 제거하는 것이 좋습니다. 예를 들어, if (!availableWorker) { throw new Error(...) } 대신 expect(availableWorker).not.toBeNull()과 같이 작성하면 테스트 결과가 더 일관되게 보고됩니다. 이 패턴은 파일 내 다른 곳(예: 255, 263 라인)에서도 발견되므로 함께 수정하면 좋겠습니다.

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