• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

berserkhmdvhb / agentic-scraper / 17350471794
87%
main: 88%

Build:
Build:
LAST BUILD BRANCH: docs/modules-funcs
DEFAULT BRANCH: main
Ran 31 Aug 2025 12:45AM UTC
Jobs 4
Files 69
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Aug 2025 12:43AM UTC coverage: 59.163% (+0.6%) from 58.581%
17350471794

push

github

berserkhmdvhb
refactor(agents.llm_fixed): improve safety, logging, and test coverage

Main code changes:
- Moved `Settings` and `ScrapeRequest` imports into TYPE_CHECKING blocks
  to satisfy ruff TC001 and reduce runtime dependencies.
- Wrapped OpenAI `AsyncOpenAI` import in a safe try/except ImportError with a
  minimal stub (`Chat`, `Completions`) for monkeypatch-based testing.
- Unified `AsyncOpenAI` binding to avoid mypy redefinition errors and support
  test stubbing consistently.
- Replaced inline log/raise strings with constants from config/messages
  (empty response, validation failure, unexpected errors, success).
- Cleaned up stub classes: used CapWords naming (`Chat`, `Completions`) and
  explicit parameters instead of `*args`/`**kwargs`, resolving ruff ANN401/N801.
- Raised exceptions using constants/variables instead of inline literals,
  fixing ruff EM101/TRY003.
- Structured `_extract_impl` flow with logging and return inside `else` block,
  resolving ruff TRY300.

Test changes:
- Added `tests/backend/scraper/agents/test_llm_fixed.py` with async unit tests
  covering success, screenshot enabled, empty content, and error handling cases.
- Implemented fake AsyncOpenAI client, chat, completions, and response objects
  to simulate OpenAI SDK behavior deterministically.
- Patched `capture_optional_screenshot` safely (non-temp path) to verify
  screenshot integration without triggering filesystem warnings.
- Used caplog/capsys assertions consistently to check logger output when
  responses are empty or errors are raised.
- Treated injected `_BoomError` as `OpenAIErrorT` to test exception handling
  branch in `extract_structured_data`.

14 of 14 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

2686 of 4540 relevant lines covered (59.16%)

4.73 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
89.13
58.02% src/agentic_scraper/backend/scraper/agents/llm_fixed.py
Jobs
ID Job ID Ran Files Coverage
1 17350471794.1 31 Aug 2025 12:45AM UTC 138
59.16
GitHub Action Run
2 17350471794.2 31 Aug 2025 12:45AM UTC 138
59.16
GitHub Action Run
3 17350471794.3 31 Aug 2025 12:45AM UTC 138
59.16
GitHub Action Run
4 17350471794.4 31 Aug 2025 12:45AM UTC 138
59.16
GitHub Action Run
Source Files on build 17350471794
  • Tree
  • List 69
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #17350471794
  • 32af98c3 on github
  • Prev Build on infra/unit-tests (#17349854085)
  • Next Build on infra/unit-tests (#17353807333)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc