-
Notifications
You must be signed in to change notification settings - Fork 1
♻️ refactor: redis Testconatiners 적용 #26
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…pwm-2024/refactor-web05-Denamu into test/test-redis-migrate
Jo-Minseok
approved these changes
Jan 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다! 혹여나 이미지 버전 선택할 수 있다면
MySQL은 8.0.39
Redis는 6.0.16-alpine으로 변경 가능하다면 부탁드립니다
CodeVac513
approved these changes
Jan 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 수고많으셨습니다.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📋 작업 내용
@testcontainers/redis라이브러리 추가레디스 동작을 컨테이너 위에서 돌리기 위해 필요한 라이브러리를 dev dependency 로 설치하였습니다.
Redis 동작 Testcontainers 적용
#22 작업과 동일하게, Redis Mock을 사용하지 않고 실제 Redis 컨테이너를 사용하도록 수정하였습니다.
이에따라 global-setup 파일명을 변경하고, MySQL, Redis 두가지 컨테이너를 세팅하는 파일로 변경하였습니다.
또한,
Redis.disconnect()를 마지막에 수행해주지 않을 시 테스트가 정상적으로 종료되지 않아 CI 스크립트가 종료되지 않는 문제가 발생했습니다. afterAll()에서 별도로 disconnect()` 처리를 하도록 하였습니다.await이 붙어있지 않은 redis 동작들 await 처리
테스트 코드 실행 후 코드를 점검 하자 몇가지 redis 동작들이 await처리가 되어있지 않음을 확인하여 await 키워드를 추가하였습니다.
테스트 suites들의 given절 오류 수정
로그인 처리를 수행하기 위해 redis에
sid정보를 저장할때,set메서드가 아닌sadd메서드를 사용하는 코드들이 있었습니다. 이 부분들을set으로 처리하도록 수정하였습니다.