Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/#172 관리자 모듈 분리에 따른 테스트 코드 개선 #173

Merged
merged 84 commits into from
Jan 18, 2025

Conversation

LeeHanEum
Copy link
Member

@LeeHanEum LeeHanEum commented Jan 12, 2025

Summary

기존의 테스트 코드는 CQRS 패턴 적용 및 관리자 모듈 분리 이전에 작성된 코드로, 이를 최신 구조에 맞게 개선했습니다.
기존 방식과 동일하게 Fake 객체를 활용하여 테스트 코드를 작성했습니다.

Tasks

  • CQRS 패턴과 관리자 모듈 구조를 반영하여 테스트 코드 개선.
  • Fake 객체를 활용해 테스트를 구현하여 외부 의존성을 제거하고 독립적으로 실행 가능한 테스트 코드 작성.
  • 테스트 실패 원인을 분석하고, 로직 및 테스트를 수정하여 테스트가 정상적으로 통과하도록 개선.

To Reviewer

AuthServiceTest는 초기 실행 시간으로 약 800ms가 소요되었으나, 다음과 같은 수정 사항을 적용하여 테스트 시간을 개선했습니다:

  • JWT 생성 시 발급 시간(issuedAt)과 만료 시간(expiration)을 설정하는 과정을 최적화.
  • reissue 테스트에서 기존에 사용하던 로그인 과정을 제거하고, 직접 필요한 데이터를 설정하는 방식으로 수정.

이러한 변경으로 인해 실행 시간이 절반 이상 감소했습니다.

Screenshot

ADMIN

image

API

image

DOMAIN

image

@LeeHanEum LeeHanEum added 🐞bug Something isn't working 🔨refactor refactoring code labels Jan 12, 2025
@LeeHanEum LeeHanEum requested a review from a team January 12, 2025 14:03
@Copilot Copilot bot review requested due to automatic review settings January 12, 2025 14:03
@LeeHanEum LeeHanEum linked an issue Jan 12, 2025 that may be closed by this pull request

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • aics-admin/build.gradle: Language not supported
@LeeHanEum LeeHanEum marked this pull request as draft January 12, 2025 14:03
Copy link
Contributor

coderabbitai bot commented Jan 12, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

워크스루

이 풀 리퀘스트는 테스트 커버리지 및 테스트 인프라에 대한 광범위한 변경을 포함하고 있습니다. GitHub Actions 워크플로우의 최소 커버리지 임계값을 10%에서 80%로 상향 조정하고, 여러 도메인 및 애플리케이션 계층에 걸쳐 새로운 테스트 클래스를 추가했습니다. 또한 일부 서비스 및 도메인 클래스의 메서드 시그니처와 파라미터 이름을 업데이트하고, 테스트 인프라를 개선했습니다.

변경 사항

파일 변경 요약
.github/workflows/pull-request-test-coverage.yml 테스트 커버리지 최소 임계값을 10%에서 80%로 상향 조정
aics-admin/build.gradle 테스트 픽스처 의존성 추가 및 JaCoCo 리포트 구성
aics-domain/src/main/java/kgu/developers/domain/lab/application/command/LabCommandService.java professor 파라미터를 advisor로 변경
여러 테스트 픽스처 클래스 새로운 테스트 클래스 추가 및 기존 테스트 클래스 제거

관련 가능성 있는 PR

제안된 리뷰어

  • LeeHanEum

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Member Author

@LeeHanEum LeeHanEum left a comment

Choose a reason for hiding this comment

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

의존성 및 테스트 모듈 추가 완료했습니다.
이후 작업 진행 부탁드려요!

@minjo-on
Copy link
Contributor

작업 이어서 시작하겠슴다~

@LeeHanEum LeeHanEum merged commit 38e9334 into develop Jan 18, 2025
5 checks passed
@LeeHanEum LeeHanEum deleted the fix/#172-test-code-refactor branch January 18, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working 🔨refactor refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

관리자 모듈 분리에 따른 테스트 코드 개선
3 participants