prgrms-web-devcourse / Team-Meoguri-Linkocean-BE

팀 머구리의 링크 오션 벡엔드 입니다
http://team-meoguri-linkocean-fe.vercel.app/
2 stars 0 forks source link

[LO-215] 컨트롤러 테스트 @Transactional 제거 & 컨밴션에 맞게 리팩토링 #217

Closed hyuk0309 closed 2 years ago

hyuk0309 commented 2 years ago

🛠️ 작업 내용

🗨️ 기타


😎 리뷰어

@ndy2 , @jk05018

github-actions[bot] commented 2 years ago

Unit Test Results

237 tests   237 :heavy_check_mark:  1m 7s :stopwatch:   72 suites      0 :zzz:   72 files        0 :x:

Results for commit c5da8a8b.

hyuk0309 commented 2 years ago

제 로컬에서는 50초 정도 걸립니다.. ㅎㅎ 20초 정도 늘어난 것 같아요.

근데 DB를 모킹해서 해결하는 방식보다는, 서비스나 컨트롤러 테스트에서 (infra 모듈을 모킹하면 어느정도 최적화가 가능할 것 같아요.) 그리고 DB도 항상 데이터를 비워주는게 아니라, 조회용 테스트, 컨맨드용 테스트로 나눠서 조회는 @beforeAll, @afterAll 커맨드는 @beforeEach, @afterEach를 사용해도 어느정도 최적화가 가능할 것 같아요!