Skip to content

[Test] 대시보드 집계 쿼리 수 검증 테스트 추가 - #345

Merged
kangcheolung merged 1 commit into
developfrom
feature/344
Sep 21, 2026
Merged

kangcheolung merged 1 commit into
developfrom
feature/344

Conversation

@kangcheolung

@kangcheolung kangcheolung commented Sep 21, 2026

Copy link
Copy Markdown
Member

📌 Description

DashboardQueryService.getSummary()는 코드상 쿼리 9개(문서 3 + 작업 4 + Worker 1 + 검색 1)로
세어지지만 이를 검증하는 테스트가 없었다. 지표를 추가하거나 조회 방식을 바꿀 때 쿼리 수가
조용히 늘어나도 알 수 없고, 이벤트 기반 push(#151)의 debounce 설계가 "1회 집계 = 쿼리 약 9개"라는
추정에 의존하고 있었다.

실제 PostgreSQL에서 Hibernate Statistics로 측정한 결과 9개로 확인되어, 이를 회귀 테스트로 고정한다.

✅ 변경 사항

  • DashboardQueryCountIntegrationTest 추가
    • 워밍업 호출 후 통계를 초기화해 첫 호출의 초기화 비용을 제외
    • getSummary() 1회의 prepared statement 수가 정확히 9개인지 검증
  • 운영 코드 변경 없음

✅ 테스트 결과

  • DashboardQueryCountIntegrationTest: 1건 통과 (실제 PostgreSQL)
  • dashboard 패키지 전체: 24건 통과 (실패 0, 오류 0)
  • 프로젝트 전체 테스트는 실행하지 않음 (테스트 파일 1개 추가만 포함)

📒 기타

closes #344

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 테스트
    • 대시보드 요약 조회 시 데이터베이스 쿼리 실행 횟수가 예상된 수준인지 검증하는 통합 테스트를 추가했습니다.
    • 실제 PostgreSQL 환경에서 요약 조회가 정확히 9개의 SQL 문을 실행하는지 확인합니다.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: DocGrid/docgrid/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 96e31254-7f7b-46b4-9ffd-44968b03f8d9

📥 Commits

Reviewing files that changed from the base of the PR and between 0b6558f and 0e5c02b.

📒 Files selected for processing (1)
  • backend/src/test/java/com/opensource/docgrid/domain/dashboard/service/query/DashboardQueryCountIntegrationTest.java
 ______________________________________________________________
< Good things come to those who commit early and review often. >
 --------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangcheolung
kangcheolung merged commit 6d9ea8c into develop Sep 21, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Test] 대시보드 집계 쿼리 수 검증 테스트 추가

1 participant