Skip to content

테스트 커버리지 향상: Backend 및 Frontend 100% 달성#620

Open
seonghobae wants to merge 1 commit into
mainfrom
test-coverage-100-percent-11094039230562261255
Open

테스트 커버리지 향상: Backend 및 Frontend 100% 달성#620
seonghobae wants to merge 1 commit into
mainfrom
test-coverage-100-percent-11094039230562261255

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator
  • 백엔드(app/db.py)에 누락된 함수들의 테스트 커버리지를 추가하여 100% 달성 (mocking pooler/connection states)
  • 프론트엔드의 GroupModal.tsx 내 누락된 onSubmit 유효성 검증 분기점 테스트 추가하여 전체 커버리지 100% 달성

PR created automatically by Jules for task 11094039230562261255 started by @seonghobae

…케이스 추가

- backend/app/db.py (get_sync_database_url, _probe_pooler_admin_console, get_pooler_detection, get_session, get_read_session) 테스트 추가
- frontend/src/components/modals/GroupModal.test.tsx 폼 제출 유효성 검사 테스트 추가
- 프론트엔드/백엔드 전체 테스트 커버리지 100% 달성
Copilot AI review requested due to automatic review settings July 22, 2026 11:41
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Comment thread backend/tests/test_db.py
await gen.__anext__()
try:
await gen.__anext__()
except StopAsyncIteration:
Comment thread backend/tests/test_db.py

@pytest.fixture(autouse=True)
def reset_pooler_cache():
import app.db
Comment thread backend/tests/test_db.py

@pytest.mark.asyncio
async def test_get_pooler_detection_cached():
import app.db
Comment thread backend/tests/test_db.py

@pytest.mark.asyncio
async def test_get_read_session_no_readonly():
import app.db
Comment thread backend/tests/test_db.py

@pytest.mark.asyncio
async def test_get_read_session_with_readonly():
import app.db
Comment thread backend/tests/test_db.py

@pytest.mark.asyncio
async def test_get_pooler_detection_locked_cache():
import app.db
Comment thread backend/tests/test_db.py

@pytest.mark.asyncio
async def test_get_read_session_return():
import app.db
Comment thread backend/tests/test_db.py
from __future__ import annotations

import time
import asyncio

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds missing unit tests to raise overall test coverage to 100%, focusing on backend DB/pooler utilities (app/db.py) and frontend GroupModal form-submit validation paths.

Changes:

  • Added React Testing Library tests for GroupModal’s onSubmit validation branches (empty/whitespace vs valid group name).
  • Added backend tests covering app/db.py helpers: sync URL conversion, pooler admin-console probing, pooler detection caching/locking behavior, and session dependency generators.
  • Added a short .Jules/ note documenting the coverage-fix approach.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
frontend/src/components/modals/GroupModal.test.tsx Adds submit-path tests for GroupModal validation and keeps accessibility test coverage.
backend/tests/test_db.py Introduces test coverage for app/db.py pooler detection and session dependencies (needs adjustments to avoid async-mocking/DB brittleness).
.Jules/test_coverage_fix.md Documents the intent and approach of the coverage-focused changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 2 to 5
import { describe, expect, it, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import { render, screen, fireEvent, cleanup } from '@testing-library/react';
import { afterEach } from 'vitest';

Comment thread backend/tests/test_db.py
Comment on lines +143 to +149
async def test_get_read_session_with_readonly():
import app.db
app.db.ReadOnlySessionLocal = MagicMock()
app.db.ReadOnlySessionLocal.return_value.__aenter__.return_value = "readonly_session"
app.db.SessionLocal = MagicMock()
app.db.SessionLocal.return_value.__aenter__.return_value = "primary_session"

Comment thread backend/tests/test_db.py
Comment on lines +124 to +129
@pytest.mark.asyncio
async def test_get_session():
async for session in get_session():
assert session is not None
break

Comment thread backend/tests/test_db.py
Comment on lines +130 to +141
@pytest.mark.asyncio
async def test_get_read_session_no_readonly():
import app.db
orig = app.db.ReadOnlySessionLocal
app.db.ReadOnlySessionLocal = None
try:
async for session in get_read_session():
assert session is not None
break
finally:
app.db.ReadOnlySessionLocal = orig

Comment thread backend/tests/test_db.py
Comment on lines +186 to +199
@pytest.mark.asyncio
async def test_get_read_session_return():
import app.db
orig = app.db.ReadOnlySessionLocal
app.db.ReadOnlySessionLocal = None
try:
gen = get_read_session()
await gen.__anext__()
try:
await gen.__anext__()
except StopAsyncIteration:
pass
finally:
app.db.ReadOnlySessionLocal = orig
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.

2 participants