# task-2144: CI Pytest 서버 테스트 실패 수정 — doc_parser import error

## ★ 프로젝트: `/home/jay/projects/InsuRo/`

## 문제
GitHub Actions CI의 Pytest 서버 테스트에서 `ModuleNotFoundError: No module named 'doc_parser'` 에러로 실패.
- `server/gdrive_sync.py` L21: `sys.path.insert(0, "/home/jay/workspace/libs")` → 로컬 전용 경로
- `server/tests/test_gdrive_sync.py`가 `gdrive_sync.py`를 import → `doc_parser`, `ingest`, `gdrive` 모듈 없음
- CI 환경에는 `/home/jay/workspace/libs/` 경로가 존재하지 않음
- `-x` 옵션으로 1건 에러에 전체 109개 테스트 중단

## 수정

### 방법: CI에서 해당 테스트 제외
`test_gdrive_sync.py`는 로컬 전용 모듈(`doc_parser`, `ingest`, `gdrive`)에 의존하므로 CI에서 실행 불가.

#### 파일: `.github/workflows/ci.yml` Pytest 스텝

**현재:**
```yaml
      - name: Pytest 서버 테스트
        run: cd server && python -m pytest tests/ -x
```

**수정:**
```yaml
      - name: Pytest 서버 테스트
        run: cd server && python -m pytest tests/ -x --ignore=tests/test_gdrive_sync.py
```

### 추가 고려: conftest.py에 조건부 skip
향후 로컬 의존 테스트가 늘어날 수 있으므로, `server/tests/conftest.py`에 아래 마커 추가 검토:

```python
import pytest

def pytest_collection_modifyitems(config, items):
    """로컬 전용 모듈 의존 테스트를 CI에서 자동 skip"""
    import os
    if not os.path.exists("/home/jay/workspace/libs"):
        skip_local = pytest.mark.skip(reason="로컬 전용 모듈 경로 없음")
        for item in items:
            if "gdrive_sync" in str(item.fspath):
                item.add_marker(skip_local)
```

단, 이건 선택사항. 최소 수정은 `--ignore` 한 줄이면 충분.

## ★ 먼저 읽을 파일
- `/home/jay/projects/InsuRo/.github/workflows/ci.yml` — Pytest 스텝 (하단)
- `/home/jay/projects/InsuRo/server/tests/test_gdrive_sync.py` — import 구조 확인

## 검증 시나리오

### 시나리오 1: CI 그린
- main push 후 CI 전체 통과 (Vitest + Pytest 모두)

### 시나리오 2: 로컬 pytest 정상
- 로컬에서 `cd server && python -m pytest tests/ -x --ignore=tests/test_gdrive_sync.py` 전체 PASS

### 시나리오 3: gh run 확인
- `gh run list --limit 1` → completed success

## 완료 시그니처
- ci.yml에 `--ignore=tests/test_gdrive_sync.py` 추가
- 커밋, main push
- CI 전체 그린 (또는 doc_parser 에러 해소)

## 레벨
- normal

## 프로젝트
- insuro