test(engine): async behavioral tests for CrawlerEngine::crawl (#39)#64
Conversation
#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
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 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 |
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.rsdrives the real loop end-to-end with no network I/O — a mockSpiderindevelopment_modeagainst a pre-seededResponseCache, 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_immediately—request_pause()beforecrawl()breaks on the first loop check (paused == true, 0 items).crawl_with_single_concurrency_still_completes—concurrent_requests(1)still drains the queue and records the configured concurrency.Test plan
#[tokio::test]s pass; full suite + clippy + fmt greenCloses #39
Generated by Claude Code