Repository navigation
Conversation
janbuchar
force-pushed
the
local-runs
branch
from
November 20, 2026 13:34
44b91ae to
4e6bccc
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a local runtime for ad-hoc Actors:
run({ runtime: 'local' })runs the Actor the way it would on somebody's machine, with the SDK's local storage and none of the platform'sACTOR_*/APIFY_*variables. See "Running locally" indocs/lib.md.defineActor) only, notapify runon an arbitrary Actor repoAPIFY_LOCAL_RUNS_ONdecides where a local run executes:machine(default) spawns the Actor on the machine running the tests,platformruns it on the platform inside the Actor's own image, through a launcher that hides the platform from it and copies its local storage to the run. The test doesn't change between the twoRunOutcomeis what both a platform and a local result provide:status,getDataset,getStatistics,getLog,getRunInfoandgetRecord.toFinishWithand the other matchers take it, andrun({ runtime: 'local' })is typed to return itRunTestResult.getRecord(key)is new, a record of the default store decoded like apify-client doesNotes for review
@crawlee/fs-storage-native, the library Crawlee 4 writes local storage with. It's native. The build for local runs on the platform gets it under the aliasapify-test-tools-storage, so it doesn't replace the Actor's own copyOUTPUT.json)CRAWLEE_DISABLE_BROWSER_SANDBOX: Chrome's sandbox can't start in a container, and the SDK only turns it off when it knows it's on the platformnpm startand to exit when donechargedEventCountscan only be asserted as 0 on a local runpreparebuilds the package and there's an.npmignore, so that test: Restructure e2e tests apify-sdk-js#863 and refactor: Restructure e2e tests using apify-test-tools crawlee#4375 can install it from a commit. Both go away before mergingchargedEventCountsintoFinishWith#262 addsfetchRunInfo, whichRunOutcomeandLocalRunResultwill need once both are in