Skip to content

Conversation

@vip-amzn
Copy link
Collaborator

Add comprehensive integration testing infrastructure that supports both local (in-memory) and cloud (AWS Lambda) test execution modes with a unified test interface.

Issue #, if available:

Description of changes:

Key Features:

  • CloudDurableFunctionTestRunner for AWS Lambda integration tests
  • Dual-mode test helper pattern for seamless local/cloud testing
  • CI/CD integration with automated cloud testing

New Infrastructure:

  • cloud_runner.py: AWS Lambda test runner with polling support
  • test_helper.py: Dual-mode test pattern implementation

Configuration Updates:

  • examples-catalog.json: Added 4 new examples
  • template.yaml: Added Lambda resources for new examples
  • pyproject.toml: Added integration test commands
  • deploy-examples.yml: Added integration test step

@vip-amzn vip-amzn changed the title feat: add dual-mode integration testing infrastructure feat(testing-sdk): add dual-mode integration testing infrastructure Oct 23, 2025
@vip-amzn vip-amzn closed this Oct 23, 2025
@vip-amzn vip-amzn reopened this Oct 23, 2025
@vip-amzn vip-amzn force-pushed the integ_tests_new branch 5 times, most recently from 87f2155 to dad2b53 Compare October 23, 2025 16:28
@vip-amzn vip-amzn requested review from bchampp and rarepolz October 23, 2025 16:47
@vip-amzn vip-amzn force-pushed the integ_tests_new branch 17 times, most recently from a1457da to c5d1d71 Compare October 28, 2025 19:00
@vip-amzn vip-amzn force-pushed the integ_tests_new branch 20 times, most recently from df1b670 to 3aa49a6 Compare October 29, 2025 18:37
Add comprehensive integration testing infrastructure that supports
both local (in-memory) and cloud (AWS Lambda) test execution modes
with a unified test interface.
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Approved w/ comments

Comment on lines +15 to +26
def simulated_get_item(name: str) -> dict[str, Any] | None:
"""Simulate getting an item that may fail randomly."""
# Fail 50% of the time
if random() < 0.5: # noqa: S311
msg = "Random failure"
raise RuntimeError(msg)

# Simulate finding item after some attempts
if random() > 0.3: # noqa: S311
return {"id": name, "data": "item data"}

return None
Copy link

Choose a reason for hiding this comment

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

If we introduce randomness like this, we should seed the random so that we don't get transient failures.

Copy link

Choose a reason for hiding this comment

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

So either seeding, or mocking the response and knowing the sequence. I prefer large sequence of randoms tested over multiple seeds.

@ghost ghost merged commit 6cadeb8 into main Oct 30, 2025
21 of 22 checks passed
@wangyb-A wangyb-A deleted the integ_tests_new branch November 18, 2025 16:58
This pull request was closed.
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.

4 participants