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

테스트 실행시간 최적화 #204

Merged
merged 4 commits into from
Nov 21, 2023
Merged

Conversation

5uhwann
Copy link
Member

@5uhwann 5uhwann commented Nov 21, 2023

Issue

Close #203

✅ 작업 내용

테스트 환경 통합을 통한 테스트 실행시간 최적화 190s -> 20s

  • TestContainer 재사용
    • 불필요한 테스트 컨테이너 코드를 제거해 테스트 컨테이너 동작 횟수 조정: 21회 -> 1회
  • 스프링 부트 서버 동작 횟수 조정: 24회 -> 2회
    • PersistenceTestSupport: SpringDataJpaTest -> SpringBootTest, 불필요 Import 제거
    • WebAdapterTestSupport: 컨트롤러 클래스 구성정보 통합 및 Mock객체 통합 관리

🤔 고민 했던 부분

  • WebAdapterTestSupport 수정 시 기존 코딩 컨벤션과 충돌
    • 기존의 코딩 컨벤션에서는 IncomingAdapter(Controller)클래스의 접근제어자를 default로 제한했지만, WebAdapterTestSupport클래스의 디렉토리 레벨이 달라 IncomingAdapter클래스들의 구성정보를 가져오는게 불가능해졌습니다. 따라서 코딩 컨벤션을 강제하는 것보다 테스트 환경 통합이 이점이 크다 생각해 기존의 컨벤션을 수정하고 public 접근제어자를 사용했습니다.

🔊 도움이 필요한 부분!!

@5uhwann 5uhwann added the ♻️ refactor 기본의 로직 변경 없이 코드 개선 label Nov 21, 2023
@5uhwann 5uhwann added this to the 리팩토링 milestone Nov 21, 2023
@5uhwann 5uhwann self-assigned this Nov 21, 2023
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Merging #204 (577774c) into develop (631873f) will increase coverage by 0.37%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #204      +/-   ##
=============================================
+ Coverage      88.03%   88.40%   +0.37%     
- Complexity       873      882       +9     
=============================================
  Files            155      155              
  Lines           2398     2398              
  Branches          60       60              
=============================================
+ Hits            2111     2120       +9     
+ Misses           256      246      -10     
- Partials          31       32       +1     
Files Coverage Δ
.../adpater/in/web/CalculateGraduationController.java 100.00% <ø> (ø)
...ecture/adapter/in/web/SearchLectureController.java 100.00% <ø> (ø)
.../parsing/adaptor/in/web/ParsingTextController.java 100.00% <ø> (ø)
...or/in/web/update/UpdateTakenLectureController.java 100.00% <ø> (ø)

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 631873f...577774c. Read the comment docs.

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

warning The version of Java (11.0.21) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link
Member

@stophwan stophwan left a comment

Choose a reason for hiding this comment

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

👍 👍 굿굿 고생했어. 도커 환경 통합이야 그렇다고 쳐도, 생각보다 컨트롤러 환경 통합도 엄청 유의미하네.

@5uhwann
Copy link
Member Author

5uhwann commented Nov 21, 2023

👍 👍 굿굿 고생했어. 도커 환경 통합이야 그렇다고 쳐도, 생각보다 컨트롤러 환경 통합도 엄청 유의미하네.

넵 스프링 부트 환경 통합만으로도 15초 정도 단축 시켰는데, 앞으로 테스트 케이스 많아지면 많아질수록 더 차이가 날거 같아서 유의미한 작업이었던 거 같네요!

@5uhwann 5uhwann merged commit a0ec713 into develop Nov 21, 2023
6 checks passed
@5uhwann 5uhwann deleted the refactor/테스트_시간_단축 branch November 21, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ refactor 기본의 로직 변경 없이 코드 개선 size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

테스트 실행시간 최적화
2 participants