Repository navigation
chore: PR마다 백엔드 테스트를 실행하는 CI 추가 - #51
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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
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.
🔍 변경 사항
백엔드 테스트가 CI에서 전혀 실행되지 않았고, 로컬에서도 기본 프로필로 앱 전체를 띄워 실제 메일 발송, 크롤링, 번역까지 실행되던 문제를 정리했습니다. 외부 부작용 없이 돌아가는
test프로필을 만들고, main으로 가는 모든 PR에서 테스트를 실행하는 워크플로를 추가했습니다.🔗 연결 이슈:
Closes #50
🛠️ 핵심 수정 사항 (How)
test 프로필
src/test/resources/application-test.properties추가. 테스트 DB(MySQL, 3307 포트) 설정과 외부 API·인프라 키의 가짜 값만 둡니다.openai.url,spring.mail.host)는 localhost로 두어, 실수로 호출돼도 요청이 밖으로 나가지 않게 했습니다.DataSetupRunner는@Profile("local-secret")이라 test 프로필에서는 뜨지 않습니다.CustomMySQLDialect는 로컬 전용(gitignore)이라 CI에서 쓸 수 없어서, 같은 역할의TestMySQLDialect를src/test에 두었습니다. CLOB 컬럼이 LONGTEXT로 생성됩니다.통합 테스트 공통 부모
IntegrationTestSupport:@SpringBootTest+@MockBean ObjectStorage.OracleStorageConfig가 빈을 만들 때 OCI 개인키 파일을 읽기 때문에 테스트 환경에서는 실제 빈을 만들 수 없습니다.BackendApplicationTests,VoaArticleCrawlerServiceTest가 이 클래스를 상속합니다. 앞으로 앱 전체를 띄우는 테스트도 이 클래스를 상속합니다.워크플로 (
backend-test.yml)SPRING_PROFILES_ACTIVE=test ./gradlew test를 실행합니다.paths필터를 걸지 않았습니다. 필터를 걸면 프론트만 바꾼 PR에서 체크가 생성되지 않아 머지가 막힙니다.timeout-minutes: 15를 두고, 실패하면 HTML 테스트 리포트를 artifact로 업로드합니다.build.gradle에testLogging.exceptionFormat = 'full'을 추가해 CI 로그에서 실패 원인 메시지를 바로 볼 수 있게 했습니다.정리
AudioServiceTest삭제SentenceRepositoryTest불필요한 주석 제거backend/.gitignore에/docs/추가검증
CustomMySQLDialect가 없는 CI와 같은 상태입니다.남은 과제
main-protectionruleset에backend-test필수 상태 체크 등록 (레포 설정 작업)VoaArticleCrawlerServiceTest.동시성_테스트의latch.await()타임아웃과ExecutorService종료 처리