Skip to content

test: add missing Crawlee and platform E2E tests - #1248

Merged
vdusek merged 2 commits into
masterfrom
test/e2e-coverage-gaps
Nov 11, 2026
Merged

vdusek merged 2 commits into
masterfrom
test/e2e-coverage-gaps

Conversation

@vdusek

@vdusek vdusek commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Adds E2E tests for SDK and Crawlee paths that had no platform test. Until now the Crawlee suite had only one happy-path crawl per crawler, while the Scrapy suite also covers abort, reboot and PPE.

  • test_crawlee/test_file_download_crawler.py: FileDownloadCrawler (new in Crawlee 1.10) downloads files in buffered and streamed mode. The test checks that the KVS records have the exact bytes and content type.
  • test_crawlee/test_ppe_crawler.py: a crawler's context.push_data stops charging once the run is over its max_total_charge_usd budget.
  • test_crawlee/test_graceful_abort_crawler.py: after a graceful abort, every handled request has its item pushed once, the request in flight stays pending, and the crawler statistics are saved in the KVS.
  • test_crawlee/test_reboot_crawler.py: a crawl of the local site, split by a reboot, visits every page once and keeps its statistics from the first container.
  • test_actor_request_list.py: ApifyRequestList.open() reads requestListSources from the Actor input (a direct url and a requestsFromUrl list) and passes the requests and their user data to a crawler through the default RQ.
  • test_actor_key_value_store.py::test_use_state_survives_reboot: the Actor.use_state() state survives a reboot.
  • test_actor_events.py: a graceful abort calls the ABORTING listener, and Actor.reboot() calls the MIGRATING and PERSIST_STATE (is_migrating=True) listeners.

The test server has two new routes: /files/<size>.<ext> for binary files and /start-urls.txt for the URL list. The URL list points to example.com, because the requestsFromUrl URL extraction only matches hosts with a top-level domain, so it skips localhost.

✍️ Drafted by Claude Code

…and PPE, `ApifyRequestList`, `use_state` and platform events
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Nov 11, 2026
@vdusek vdusek self-assigned this Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.93%. Comparing base (7cbae95) to head (6c994bb).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1248   +/-   ##
=======================================
  Coverage   93.93%   93.93%           
=======================================
  Files          54       54           
  Lines        3828     3828           
=======================================
  Hits         3596     3596           
  Misses        232      232           
Flag Coverage Δ
e2e 31.24% <ø> (ø)
integration 51.01% <ø> (ø)
unit 91.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek requested a review from Pijukatel November 11, 2026 13:08
@vdusek
vdusek marked this pull request as ready for review November 11, 2026 13:08
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Nov 11, 2026
@vdusek vdusek changed the title test: add E2E tests for FileDownloadCrawler, crawler abort, reboot and PPE, ApifyRequestList, use_state and platform events test: add missing Crawlee and platform E2E tests Nov 11, 2026
@vdusek
vdusek requested a review from Mantisus November 11, 2026 13:11

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apify-approval-mirror apify-approval-mirror Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirroring approval from @Mantisus.

@vdusek
vdusek merged commit 3638c75 into master Nov 11, 2026
46 checks passed
@vdusek
vdusek deleted the test/e2e-coverage-gaps branch November 11, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants