Skip to content

test(extras): add an end-to-end test for the microvm operation - #775

Closed
Vivek0712 wants to merge 1 commit into
aws:feat/microvm-operationfrom
Vivek0712:test/microvm-e2e
Closed

Vivek0712 wants to merge 1 commit into
aws:feat/microvm-operationfrom
Vivek0712:test/microvm-e2e

Conversation

@Vivek0712

Copy link
Copy Markdown

Stacked on #769: this PR targets feat/microvm-operation, so the diff shows only the e2e commit. It moves to main when #769 merges.

This ports the JavaScript SDK's extras/e2e to Python, as packages/aws-durable-execution-sdk-python-extras/e2e/run_e2e.py. It runs the microvm operation and the MicroVM worker against a real account. Both are built from the branch, so a run tests the change under review.

What it does

  1. Builds the core SDK, extras, and the MicroVM worker as wheels.
  2. Creates or reuses a bucket and three roles, all named dex-microvm-e2e-py-*.
  3. Builds a MicroVM image from e2e/microvm/ with the worker. The image name carries a hash of the sources, so an unchanged worker reuses the image.
  4. Deploys e2e/function/index.py as a durable function, Python 3.13 on arm64, and publishes a version.
  5. Runs each scenario as a durable execution, and checks the outcome, the operation history, and that every launched MicroVM ends TERMINATED.

The scenarios and the function's events are copied from the JavaScript runner. So a case added on one side can be added on the other with the same event.

Scenarios

Default run: succeed, fail, crash, too-large-for-the-run-hook, run-hook-cjk, run-hook-emoji, parallel. Optional: long-job.

Pending, skipped unless named in E2E_SCENARIOS:

  • terminated: needs the worker's terminate action.
  • request-succeed, request-fail, auto-http, auto-http-cjk: need delivery over HTTP. too-large-for-the-run-hook checks today's behaviour and goes away then.
  • session, suspend-session, idle-probe: need microvm_session.

Each pending scenario already has the JavaScript expectations. Turning one on means removing pending and adding its branch to the function.

Differences from the JavaScript runner

  • It uses boto3 instead of the AWS CLI.
  • It compares the error type's class name. Python reports the fully-qualified name.
  • It expects the core subtypes (RunInChildContext, Callback, Step), since custom subtypes wait for [Feature]: Custom subtype for step, callback, and child context operations #749. E2E_SUB_TYPES=custom switches to the JavaScript ones.
  • It starts a scenario only when its MicroVMs fit E2E_MAX_MICROVMS, 4 by default. A new account may allocate 8 GB of MicroVM memory, and each MicroVM has 2 GB. Without the budget, parallel hit ServiceQuotaExceededException on one item, and the other item's MicroVM kept running.
  • E2E_IMAGE_ARN and E2E_FUNCTION_ARN reuse an existing image or function. With the JavaScript e2e image, terminated passes, which checks the operation against both workers.

Testing

Run in us-east-1 from this branch:

  • Default run: 7 of 7 passed, every MicroVM TERMINATED.
  • With E2E_IMAGE_ARN set to the JavaScript e2e image: succeed and terminated passed, the latter with MicrovmJobFailedError (MicrovmTerminatedError) 20 s in.
  • ruff check, ruff format --check, and mypy pass on the new files.

Wiring it into cloud-tests.yml needs the test account's image build role, so I left that out.

🤖 Generated with Claude Code

@Vivek0712
Vivek0712 deployed to ai-pr-review-runtime October 14, 2026 16:03 — with GitHub Actions Active
Port the JavaScript SDK's extras/e2e to Python. The runner builds the
core SDK, this package, and the MicroVM worker from the repository,
deploys a MicroVM image and a durable function, and checks each
scenario's outcome, its operation history, and that every MicroVM
was terminated.

- The scenarios and the function's events are the JavaScript ones, so
  both SDKs are checked against one list.
- Scenarios that need delivery over HTTP, microvm_session, or the
  worker's terminate action are pending until those land.
- The runner starts a scenario only when its MicroVMs fit the
  account's memory quota.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ParidelPooya
ParidelPooya deleted the branch aws:feat/microvm-operation October 14, 2026 19:09
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.

2 participants