🔧 fix: export 및 extract_text 도구들의 100% 테스트 커버리지 달성 - #773
Conversation
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough네 개 도구 모듈의 ChangesCLI 진입점 커버리지 검증
synthetic fixture 문서 문자열 갱신
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🟡 Moderate · up to The PR only removes coverage exclusions and strengthens tests around existing CLI help exits, so user-facing behavior should remain unchanged. It is not merge-ready yet because required checks are still queued and the required independent approval is missing; merge should wait for those gates. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
|
이번 quality slice를 기존 coverage PR에 겹쳐 넣었습니다. 새 PR은 만들지 않았습니다.
이 slice의 목적은 |
내용 확인했습니다. 이번 변경 사항은 테스트 커버리지를 높이기 위해 추가된 것이며 향후 다중행 문서화를 통한 품질 향상도 참고하여 적용했습니다. |
| """Generate a synthetic scanned-newspaper PDF fixture and ground-truth JSON. | ||
|
|
||
| A deterministic PDF and JSON structure configuration will be stored inside the target `output_dir` parameter. |
There was a problem hiding this comment.
Noema LLM review
The PR successfully achieves 100% test coverage for the export and extract_text tools by removing '# pragma: no cover' from the entry points and adding corresponding test_module_main tests. These tests correctly use runpy.run_module and pytest.raises(SystemExit) to verify that the CLI help flag (-h) triggers a clean exit (code 0), addressing previous reviewer concerns regarding functional correctness and coverage gaps. Docstring enhancements in src/newsdom_api/synthetic.py improve maintainability without introducing behavioral regressions.
Reviewed changed lines
tests/test_tools_export_csv.py:123 (RIGHT): Correctly implementstest_module_mainusingrunpyand assertsSystemExitwith code 0 for the help flag, ensuring the entry point is executed and tested.tools/export_csv.py:93 (RIGHT): Removal of# pragma: no coverallows the coverage tool to track theif __name__ == "__main__":block, which is now covered by the new test.src/newsdom_api/synthetic.py:1 (RIGHT): Expanded module docstring provides better context for the synthetic fixture generation tools.
Adversarial validation
tests/test_tools_export_csv.py:123 (RIGHT)falsified: The test passes even if themain()call is removed from the tool's entry point. — The test explicitly usespytest.raises(SystemExit)and assertsexcinfo.value.code == 0. Ifmain()(which callsargparseand thussys.exit) were missing, the test would fail.tests/test_tools_export_html.py:181 (RIGHT)falsified: The test fails to isolate the module execution, leading to state leakage. — The test usesmonkeypatch.delitem(sys.modules, ...)to force a reload of the module viarunpy, ensuring isolation.- Residual risk: Low
Findings
- No blocking findings.
- Result: APPROVE
- Head SHA:
0a5e0cbcceabd750d88266a9df33e86f4b552253 - Reviewer credential:
noema-review-github-app-refresh - Actor:
cwl-noema-review[bot]
Scope
Exercise the four shipped CLI
__main__entry points intools/export_csv.py,tools/export_html.py,tools/export_markdown.py, andtools/extract_text.pyinstead of excluding those lines with# pragma: no cover.Current exact identity
7cf2655f59141d60df9a73b74bcab0961a4d981ddevelop@e06b1f3fb10903569124af011da213951e6e2473Regression contract
The original entry-point tests could falsely pass when
runpy.run_module(..., run_name="__main__")returned normally, becauseSystemExitwas only inspected inside an optionalexceptblock. They also removed modules directly fromsys.moduleswithout automatic restoration.The current tests now:
SystemExitwith exit code0for each-hmodule execution, so removal of themain()invocation fails the test;monkeypatch.delitem(..., raising=False)so pytest restores module-cache state;# pragma: no coverguards.No current-head
tests/test_docstring_quality.pyorsrc/newsdom_api/synthetic.pychange exists in this PR. Earlier reviewer/summary prose referring to those files came from predecessor branch states and is not current-head evidence.Fresh evidence boundary
For exact head
7cf2655f59141d60df9a73b74bcab0961a4d981d, the repository workflow runs currently materialized for ClusterFuzzLite, scorecards, CodeQL, container image, dependency review, quality gate, tests, Security Scan, and SAST Semgrep are all queued. Queued evidence is non-passing. All currently materialized inline review threads are resolved/outdated, but there is no qualifying independent non-author human approval for this exact head.Do not transfer predecessor-head check or review results to this head. Merge only when the unchanged exact head has every then-live required repository and organization workflow terminal-success, zero valid unresolved findings, required 100% owned production statement/branch coverage evidence, and the required qualifying independent approval.
PR originally created by Jules for task 11646378742078810923 started by @seonghobae
Summary by CodeRabbit
테스트
문서
품질 개선