Skip to content

test(engine): async behavioral tests for CrawlerEngine::crawl (#39)#64

Merged
Liohtml merged 1 commit into
masterfrom
claude/engine-crawl-tests
Jun 24, 2026
Merged

test(engine): async behavioral tests for CrawlerEngine::crawl (#39)#64
Liohtml merged 1 commit into
masterfrom
claude/engine-crawl-tests

Conversation

@Liohtml

@Liohtml Liohtml commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the missing async coverage for CrawlerEngine::crawl (#39). The crawl loop (concurrency limiting, checkpoint restore, pause, task spawning) previously had no #[tokio::test].

New tests/engine_crawl.rs drives the real loop end-to-end with no network I/O — a mock Spider in development_mode against a pre-seeded ResponseCache, so every request resolves from disk:

  • crawl_processes_all_urls_from_cache_and_terminates — all seeded URLs processed via cache hit, items collected, loop terminates (a hang fails the test).
  • pause_before_crawl_stops_immediatelyrequest_pause() before crawl() breaks on the first loop check (paused == true, 0 items).
  • crawl_with_single_concurrency_still_completesconcurrent_requests(1) still drains the queue and records the configured concurrency.

Test plan

  • 3 new #[tokio::test]s pass; full suite + clippy + fmt green
  • Hermetic — no network access (dev-cache path)

Closes #39


Generated by Claude Code

#39: the async crawl loop had no #[tokio::test] coverage. Add tests/engine_crawl.rs
exercising the real loop end-to-end without network I/O by running a mock Spider
in development_mode against a pre-seeded ResponseCache:

- crawl_processes_all_urls_from_cache_and_terminates: every seeded URL is
  processed via cache hit, items collected, and the loop terminates (a hang
  would fail the test).
- pause_before_crawl_stops_immediately: request_pause before crawl makes the
  loop break on its first check (paused=true, zero items).
- crawl_with_single_concurrency_still_completes: concurrent_requests(1) still
  drains the queue and records the configured concurrency.

Closes #39

https://claude.ai/code/session_012RmdaovmNWZVAim4XxCWwn
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Liohtml, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 24 minutes and 1 second. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c4e15fb6-8d7f-4f54-b44d-a845ad162460

📥 Commits

Reviewing files that changed from the base of the PR and between df3c600 and 280c02c.

📒 Files selected for processing (1)
  • tests/engine_crawl.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/engine-crawl-tests

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.

@Liohtml Liohtml merged commit df09f89 into master Jun 24, 2026
8 checks passed
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.

[repo-health] Medium: CrawlerEngine::crawl() has no async unit tests — concurrent crawl logic is untested

2 participants