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

feat-be: Redis 로컬 환경 설정 #822

Open
wants to merge 7 commits into
base: be/develop
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 15, 2024

목적

로컬 환경에 Redis 설정을 추가합니다.

작업 세부사항

  • Redis 의존성 추가
  • application.yml 설정 추가
  • docker-compose 파일 작성
  • Redis 설정 파일 작성
  • 테스트용 컨트롤러 & 테스트 코드 작성

참고사항

  • 각자 로컬에 설치된 도커에서 아래 명령어 실행하면 됩니다(설치되어 있겠죠..?).

    • docker-compose -f docker-compose.local.yml up -d
    • docker-compose -f docker-compose.local.yml down
  • 레디스 연동 확인 겸 테스트 컨트롤러랑 테스트 코드를 작성해 두었는데요, 맞게 작성했는지 확신은 안 서네요. 😅

    • 직접 애플리케이션을 실행해서 테스트하고 싶다면 컨트롤러에 있는 /redis-test 엔드포인트로 요청 보내면 됩니다.
    • 아니면 테스트 코드(RedisTest)를 실행해 보면 됩니다.

질문

  • 인가 관련해서는 어떻게 설정하면 되나요?
  • 저는 우선 테스트를 쉽게 하기 위해 제 로컬에서 WebMvcConfig 코드에 해당 엔드포인트를 추가하고 진행했어요.

아래의 별표줄 밑에 요구사항 ID만 작성해주세요. Prefix 금지!


REDIS_01

closes #821

@github-actions github-actions bot added backend 백엔드 feature 새로운 기능 labels Oct 15, 2024
@github-actions github-actions bot added this to the 스프린트 6.0 milestone Oct 15, 2024
@cutehumanS2 cutehumanS2 marked this pull request as ready for review October 15, 2024 08:51
Copy link
Contributor Author

1728982317.884359

Copy link
Contributor Author

📌 Test Coverage Report

Overall Project 79.13% -0.37%
Files changed 55.07%

File Coverage
RedisConfig.java 100% 🍏
RedisTestController.java 16.22% -83.78%

Copy link
Contributor

@Dobby-Kim Dobby-Kim left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 냥인😃😃

낯선 개념이라 도입에 고민이 많았을 것 같은데 잘 해주신 것 같습니다!

제가 상황이 상황인지라,,^^ 실행은 못해보고 코드로 봤을 때 보이는 지점만 몇 가지 제안드렸습니다

천천히 보시고 의견 남겨주세요오

Copy link
Contributor

Choose a reason for hiding this comment

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

Test용이라면 test 패키지에 넣어두면 좋을 것 같습니다!
또한, 현재 test controller에 존재하는 메서드에서는 facade 계층을 이용하지 않고 있는데, 추후 추가될 기능을 생각해서 facade도 지금 초안 정도는 만드시는것이 좋을 것 같아요 :>

Copy link
Contributor

Choose a reason for hiding this comment

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

제목이 local인 것에 비해 redis만 관리하고 있는 스크립트니까 redis로 파일명을 바꾸거나 따로 local용 docker-compose 파일을 만드시는게 어떨까요?

image: redis:latest
container_name: redis-local
ports:
- "6379:6379"
Copy link
Contributor

Choose a reason for hiding this comment

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

6379-> 6379로 포트 바인딩을 같은 포트 번호로 하는 것보다
User Port 범위(1024~49151) 내의 임의의 포트를 지정해주는 것이 어떨까요?

로컬에서 모종의 의유로 중복 사용될 수도 있을 것 같아서요


@RestController
@RequestMapping("/redis-test")
public class RedisTestController {
Copy link
Contributor

Choose a reason for hiding this comment

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

이 테스트 클래스에서 key의 life cycle을 관리하는 테스트도 만들어보시는 것이 어떨까요?

저희 메일 인증 기능의 핵심인 것 같아서요!

@woowacourse-teams woowacourse-teams deleted a comment from github-actions bot Oct 15, 2024
@woowacourse-teams woowacourse-teams deleted a comment from github-actions bot Oct 15, 2024
@woowacourse-teams woowacourse-teams deleted a comment from github-actions bot Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend 백엔드 feature 새로운 기능
Projects
Status: 검토중
Development

Successfully merging this pull request may close these issues.

2 participants