CI 개선: JaCoCo 커버리지 및 테스트 리포트 추가#159
Conversation
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
CI 워크플로우 최적화 및 리포트 업로드 .github/workflows/ci.yml |
./gradlew build -x test + ./gradlew test 이중 실행을 ./gradlew build로 단일화. 테스트 결과(build/reports/tests/test/) 및 커버리지 리포트(build/reports/jacoco/test/) 아티팩트 업로드 단계 추가. PR에 madrapps/jacoco-report를 사용한 자동 커버리지 댓글 기능 추가. |
JaCoCo 플러그인 통합 및 리포트 생성 build.gradle |
JaCoCo 플러그인 적용. test 태스크가 jacocoTestReport로 finalize되도록 설정하여 테스트 완료 후 자동으로 커버리지 리포트 생성. XML 및 HTML 형식의 리포트 생성 구성. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
🐰 CI 흐름 다다닥닥, 커버리지 측정 쌩쌩
테스트 리포트 짐작 쏙쏙, 품질 관리 따끈따끈
JaCoCo와 함께 춤을 춰, 중복은 안녕~! 🎉
🚥 Pre-merge checks | ✅ 5 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Merge Conflict Detection |
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | PR 제목 'CI 개선: JaCoCo 커버리지 및 테스트 리포트 추가'는 변경사항의 주요 목표(JaCoCo 커버리지 측정 및 테스트 리포트 추가)를 명확하고 간결하게 설명합니다. |
| Linked Issues check | ✅ Passed | 모든 연관 이슈 #158의 요구사항이 충족되었습니다: (1) 빌드/테스트 단일화 [#158], (2) JaCoCo 플러그인 적용 및 커버리지 리포트 생성 [#158], (3) 테스트 결과 및 커버리지 리포트 업로드 [#158], (4) PR 커버리지 댓글 기능 추가 [#158]. |
| Out of Scope Changes check | ✅ Passed | 모든 변경사항이 #158의 CI 워크플로우 개선 범위 내에 있으며, 범위를 벗어나는 변경사항은 없습니다. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
158-ci-개선-테스트-커버리지-측정-및-리포트-업로드-추가
⚔️ Resolve merge conflicts (beta)
- Auto-commit resolved conflicts to branch
158-ci-개선-테스트-커버리지-측정-및-리포트-업로드-추가 - Create stacked PR with resolved conflicts
- Post resolved changes as copyable diffs in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Around line 49-58: Update the GitHub Actions step named "PR 커버리지 댓글" to use
madrapps/jacoco-report@v1.7.2 instead of v1.7.1 and set sensible coverage gate
values by changing min-coverage-overall and min-coverage-changed-files from 0 to
your desired thresholds (for example 50 or 60) to enforce coverage checks;
ensure the step still relies on previous steps so it will be skipped if the
JaCoCo XML report (paths: build/reports/jacoco/test/jacocoTestReport.xml) is not
generated.
🧹 Nitpick comments (2)
build.gradle (1)
95-100: 커버리지 측정 대상에서 비즈니스 로직 외 클래스 제외 고려현재 모든 클래스가 커버리지 측정 대상입니다. 향후 커버리지 임계값을 설정할 때, config 클래스, DTO, Entity 등을 제외하면 커버리지 수치가 더 의미 있어집니다.
♻️ 참고용 예시
jacocoTestReport { dependsOn test reports { xml.required = true html.required = true } + afterEvaluate { + classDirectories.setFrom(files(classDirectories.files.collect { + fileTree(dir: it, excludes: [ + '**/config/**', + '**/dto/**', + '**/*Application*' + ]) + })) + } }.github/workflows/ci.yml (1)
35-47: 아티팩트 업로드 시 파일 미존재 처리 추가 권장컴파일 실패 등으로 리포트 디렉토리가 생성되지 않은 경우,
actions/upload-artifact@v4가 에러를 발생시킬 수 있습니다.if-no-files-found옵션을 추가하면 불필요한 에러 로그를 방지할 수 있습니다.♻️ 제안
- name: 테스트 결과 업로드 if: always() uses: actions/upload-artifact@v4 with: name: test-results path: build/reports/tests/test/ + if-no-files-found: warn - name: 커버리지 리포트 업로드 if: always() uses: actions/upload-artifact@v4 with: name: coverage-report path: build/reports/jacoco/test/ + if-no-files-found: warn
📊 테스트 커버리지 리포트
|
🧪 테스트 결과144 tests 142 ✅ 3s ⏱️ Results for commit dfd95fb. ♻️ This comment has been updated with latest results. |
Summary
build -x test+test2단계를build하나로 통합madrapps/jacoco-report)closes #158
Test plan
Summary by CodeRabbit
Chores