Merge testing repo into this monorepo#423
Conversation
Initial test framework to run AWS Durable Functions locally in a unit test environment. Includes validation for: - step - wait - run_in_child_context - create_callback - wait_for_callback - wait_for_condition - parallel - map
Renamed the external module references from aws_durable_functions_sdk_python
to aws_durable_execution_sdk_python and updated the testing module name from
aws_durable_functions_sdk_python_testing to aws_durable_execution_sdk_python_testing
throughout the entire codebase.
Also update Lambda Service API to include new durable_execution_arn arg.
1. Updated all import statements across 52 files including:
- All Python source files in src/aws_durable_execution_sdk_python_testing/
- All test files in tests/
- Documentation files (README.md, CONTRIBUTING.md)
2. Fixed API compatibility issues that arose from the module rename:
- Updated InMemoryServiceClient.checkpoint() method to include the new
durable_execution_arn parameter
- Updated InMemoryServiceClient.get_execution_state() method to include
the new durable_execution_arn parameter
- Updated corresponding test cases to use the new method signatures
- Added appropriate # noqa: ARG002 comments for unused parameters in
the in-memory implementation
3. Maintained code quality standards:
- All 406 tests pass ✅
- Type checking passes ✅
- Code formatting passes ✅
- Test coverage remains above 99% (99.15%) ✅
Add ci to sync package with Gitfarm --------- Co-authored-by: hsilan <[email protected]>
…n permissions (#5) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
- Fix checkpoint processor to preserve attempt count and timestamp - Update InvokeOptions with latest svc signature - Add DurableChildContextTestRunner
Example test was failing because return type now deserialized.
next_attempt_timestamp is a datetime now, not a str.
Implement complete HTTP service that mimics AWS APIs for local durable function testing. Add cli to start web-runner and invoke methods on it. It has a multi-threaded server, strongly-typed routing, and AWS CLI compatibility. Note this PR does not fully implement all features. This is a stub to get the end-to-end flow hooked up. Specifically the various list and history apis are not implement yet. Temporarily lower cov minimum to 96% while placeholder functionality still in place. - Add ThreadingHTTPServer-based WebServer with graceful shutdown - Implement strongly-typed Route system with Router class for efficient path matching and parameter extraction - Create comprehensive HTTP models with AWS serialization integration - Add boto3-compatible serialization using rest-json protocol - Implement Router class with pattern matching for all AWS API endpoints - Add EndpointHandler base class with common HTTP utilities and error handling - Create complete handler implementations for all durable execution operations - Integrate shared router and handler registry for thread-safe request processing - Add comprehensive serialization dataclasses with from_dict/to_dict methods - Implement AWS rest-json serialization using botocore components - Support all AWS Lambda durable execution endpoints (/2025-12-01/*) - Add automatic fallback from AWS to JSON serialization - Create dex-local-runner CLI with start-server, invoke, get-durable-execution, and get-durable-execution-history commands - Add comprehensive configuration via CLI args and AWS_DEX_* env variables - Integrate LambdaInvoker for better Lambda service compatibility - Support boto3 client integration with lambdainternal-local service - Add comprehensive AWS-compatible exception mapping (400/404/409/500) - Implement consistent error response formatting across all endpoints - Add request validation with proper field checking and type safety - Support operation-specific error codes and messages
* feat: add python SDK examples and CLI tool for managing them * fix: update deployment script to package python files at root level * fix: skip wait for callback in integration test
…g durable config (#23)
fix: update branch in default pr template
Signed-off-by: Astraea Sinclair <[email protected]>
Co-authored-by: Alex Wang <[email protected]>
Co-authored-by: Alex Wang <[email protected]>
Co-authored-by: Alex Wang <[email protected]>
Create emulator image from the python testing library. The image tag will be the aws-durable-sdk-python-testing version with v prefixing it, e.g. v1.1.1. --------- Co-authored-by: hsilan <[email protected]>
- Introduce a shared Lambda client config with a 960s read_timeout and retries disabled - Route all Lambda client construction through a single helper
* remove requests library * update timeout and handling of timeout errors
- notify-issues.yml: issue notifications - notify-pr.yml: pull request notifications - notify-release.yml: callable workflow for release notifications - pypi-publish.yml: call notify-release after successful publish
After PR #216, durable-execution ARNs minted by Execution.new() contain a literal '/' of the form "<uuid>/<invocation-id>". boto's rest-json serializer percent-encodes '/' as %2F in the non-greedy {DurableExecutionArn} URI label, so paths arriving at the local WebServer look like: /2025-12-01/durable-executions/<uuid>%2F<invocation-id> The same shape applies to ListDurableExecutionsByFunction with function names like "MyFunction:$LATEST" (':' -> %3A, '$' -> %24). Without decoding, store lookups never match the key and every Get/State/History/Checkpoint/Stop returns 404. List queries silently return an empty result set. - Decode each segment once in Route.from_string. raw_path is kept as the original wire string for logging. Splitting on '/' happens before decoding so a captured value containing %2F stays inside its segment instead of acting as a path separator. - Remove the now-redundant per-route unquote() calls from the three callback routes (added in #117 for the same bug shape). - Add a real-boto regression test under tests/web/e2e/ that drives a live WebServer for every affected operation with values containing the characters boto percent-encodes. Closes the test-coverage gap that let the bug ship. - Strengthen test_route_with_special_characters to assert both segments[N] and the named field are decoded while raw_path keeps the wire form. Affects users running WebRunner / dex-local-runner against their durable function in RIE; pre-fix, the function 404s on its first checkpoint after upgrading to 1.2.0. Closes #222
508f391 to
3399283
Compare
|
we could keep the version history with some re-writing doing We could use built-in filter branch Instead, something like: The result: a linear merge_testing branch with all 143 testing commits replayed on top of main, every commit looking as if files always lived under packages/aws-durable-execution-sdk-python-testing/. No merge commit, and git |
yaythomas
left a comment
There was a problem hiding this comment.
see suggestion re keeping version history
|
What was the real concern?
tags are not be imported in this PR
renaming isn't necessary as the git history command works across rename properly |
|
the PR as it stand right now with merge commits forbidden requires a squash which will abandon the history of testing library, and can't rebase due to conflicts. The important commits in this PR here effectively has goal is to 1) keep history (important) and 2) avoid merge commit (nice to have). as far as I can see the options are: A) rebase the commits you have here into main (but here the rename boundary remains, where Even if we did go C, to avoid the "double" merge commit you'd pretty much have to do the work of A. |
|
Rebase will make the history unreadable. I'll probably abandon the history or create a merge commit. If merge by GitHub will create a new commit, I'll push directly to main branch |
3399283 to
a05ccd1
Compare
Issue #, if available:
Fix aws/aws-durable-execution-sdk-python-testing#226
Description of changes:
Review only the last 3 commits in this PR
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.