Conversation
…ies when called in the dockerfile.
…d the custom entrypoint. Changing test-rie signature.
0fb86a2 to
b414e80
Compare
b414e80 to
2b40b80
Compare
| run: docker build . -t local/test -f Dockerfile.rie | ||
|
|
||
| - name: Run tests | ||
| uses: aws/containerized-test-runner-for-aws-lambda@v1 |
There was a problem hiding this comment.
Does this action exist? The ci is failing to find it, and I don't see references elsewhere on the Internet.
I wonder if the existing test-rie workflow is close to what you want here, and could be adapted?
Seems like the main thing missing would be a small script to translate the request mappings into curl requests that assert against the response? Along with some parameterizing to feed in the proper lambda binary and test assets to the dockerfile?
There was a problem hiding this comment.
(I like what you are trying to do here with the testing harness though, seems super handy... If the referenced action is in development / not yet public... Excited to see it!)
There was a problem hiding this comment.
Sorry 😢 for this you miss some context here, and I had no time to write this in the appropriate channel. This stuff is agreed with @maxday.
That action is already used in the ruby repo and Maxime is actively working in making it public. The idea is to use the same harness test framework in all lambda runtimes.
I created a CR on that repo and this one is dependent on that to be working.
There was a problem hiding this comment.
BTW I think the existing test-rie way of dealing with those tests will be removed in favor how the harness test standard that easily allow you to make assertions on the lambda response.
|
There's already docker infra scripts written by Antonia. |
|
I know but this is doing something different. It's integrating this stuff in the harness test GHA created by @maxday . The idea is to port every RIC to use the same test framework. Beside that this one also allows to use examples as task to be run inside the harness test framework. |
|
I don't think that is needed as we already do e2e tests on PR. I understand the need for uniformity, but I think other runtimes should move to this model, rather than introducing a language nobody wants to learn. For rust in particular, we can inject a custom client into the runtime and get this without dealing with additional tooling, and we can also test the client by itself with just a custom server — this server simulator code is already available. Ultimately, not my decision, but I think this is a waste of time and resources. |
|
Thanks for your feedback @FullyTyped ! |
| dockerized-test: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| ACTIONS_STEP_DEBUG: true |
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Set up Python 3.14 |
There was a problem hiding this comment.
I think you can now remove this as the action is now Dockerized, no need for python anymore
PR_DESCRIPTION.md
Outdated
| - [x] I confirm that I've ran `cargo +nightly fmt`. | ||
| - [x] I confirm that I've ran `cargo clippy --fix`. | ||
| - [x] I confirm that I've made a best effort attempt to update all relevant documentation. | ||
| - [x] I confirm that my contribution is made under the terms of the Apache 2.0 license.on. |
There was a problem hiding this comment.
nit: Looks like a duplicate checkbox + stray .on. at the end of the license line.
There was a problem hiding this comment.
Sorry removing it from the PR.
|
I wrote the server in this crate in other tests because it was far easier than using RIE and harness tests, and it allows you to evaluate the actual state of the runtime programmatically in a white-box approach. There is a reason I did that way when I wrote those tests, Max. ~ Quinn Let's maybe not assume ignorance next time we talk to contributors :) |
|
I meant we don't use custom server in the GitHub action as we use the RIE sorry if that was not clear. Also I'm definitely not assuming anything, I'm simply explaining why we are introducing the RIE and providing a link for those who aren't familiar with it and might find this PR later. |
📬 Issue #, if available:
N/A
✍️ Description of changes:
This PR adds Docker-based testing infrastructure using AWS's
containerized-test-runner-for-aws-lambda, enabling automated testing of Lambda functions in a containerized environment that closely mirrors the AWS Lambda execution environment.The PR introduces a
test-dockerizedMakefile target that runs test suites defined intest/dockerized/*.jsonfiles. These test suites specify handlers to test (from the examples directory), request payloads, and expected response assertions with optional jq transforms for validation.The infrastructure reuses Lambda binaries from the
/examplesfolder as test handlers, demonstrating the concept with an initial test case forbasic-lambda. Additional tests and multi-concurrency scenarios can be added by creating new test suite JSON files.A GitHub Actions workflow provides CI/CD integration for automated testing on pull requests.
Testing
Run dockerized tests locally:
Run RIE tests:
make test-rie HANDLERS_TO_BUILD="basic-lambda basic-sqs" make test-rieBuild specific examples:
EXAMPLES="basic-lambda basic-lambda-concurrent" make build-examples🔏 By submitting this pull request
cargo +nightly fmt.cargo clippy --fix.