ci: simplify integration test#216
Conversation
|
|
||
| // Read the handler from the environment variable | ||
| const char* handler_name = std::getenv("_HANDLER"); | ||
| const char* handler_name = std::getenv("HANDLER"); |
There was a problem hiding this comment.
_HANDLER is correct though https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime
oh I see it's related to the .zip -> oci swap and movement of resource management from the tests code to the github actions code
| Model::FunctionCode funcode; | ||
| funcode.SetZipFile(std::move(zip_file_bytes)); | ||
| create_function_request.SetCode(std::move(funcode)); | ||
| create_function_request.SetRuntime(Aws::Lambda::Model::Runtime::provided_al2); |
There was a problem hiding this comment.
overall feedback: this integration test coverage isn't equivalent to what was being done in CodeBuild. Now the functions are uploaded as images, whereas before they were uploaded as .zip
In otherwords, this test workflow refactor loses coverage of the https://github.com/awslabs/aws-lambda-cpp/blob/master/packaging/packager script (see add_custom_target(aws-lambda-package-lambda-test-fun in test/resources/CMakeLists.txt) which was one of the things we spent a bunch of time figuring out for this project.
This is important coverage to keep, as this project has been usable from multiple operating systems from the start without requiring Docker
There was a problem hiding this comment.
I see. Just to make sure we want to:
- still build the RIC from different OS (in container)
- package the resulting binary in zip
- test on zip-deployed AWS Lambda with provided al2023 runtime
is that correct?
In any case, I would love to keep those OCI tests, as it increases the coverage and ensure that the RIC is compatible with different base OS when deployed as OCI image. WDYT?
There was a problem hiding this comment.
oh yeah for sure keep the OCI versions too.
zip versions I think would be a similar matrix to what you have already for the unit-test, with an added step to ninja install aws-lambda-package-lambda-test-fun before doing similar function create + invoke steps
| endif() | ||
|
|
||
|
|
||
| find_package(AWSSDK COMPONENTS lambda iam QUIET) |
There was a problem hiding this comment.
torn on losing this.
Like it's nice that there's not an AWS SDK CPP install required any more, which took ages and needed to be hidden by caching in the build images. But now there's not a way to run the integration tests without triggering CI. https://github.com/awslabs/aws-lambda-cpp/blob/master/README.md#running-unit-tests-locally
I think it's worth keeping (but also changing in whatever way is needed to not explode CI runtimes if the caching is getting lost)
Summary
Replace the legacy CodeBuild-based CI with a GitHub Actions workflow that runs unit tests in containers
and integration tests against real Lambda functions deployed as OCI images.
deleted)
alpine, arch)
Lambda functions, invoke them, and assert against snapshot files
Changes
integration-test job (build → ECR push → Lambda deploy → invoke → assert → cleanup)
Dockerfiles (al2023, alpine, arch, ubuntu)
lambda_function.cpp multi-handler binary
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.