Skip to content

ci: simplify integration test#216

Open
maxday wants to merge 16 commits into
masterfrom
maxday/integ-test
Open

ci: simplify integration test#216
maxday wants to merge 16 commits into
masterfrom
maxday/integ-test

Conversation

@maxday
Copy link
Copy Markdown
Contributor

@maxday maxday commented May 29, 2026

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.

  • Remove all ci/codebuild/ infrastructure, vendored gtest, and old integration test harness (~27k lines
    deleted)
  • Add a new integration-tests.yml workflow with a matrix of 5 OS targets (al2023, al2023-arm, ubuntu,
    alpine, arch)
  • Unit tests run in native containers; integration tests build Docker images, push to ECR, deploy as
    Lambda functions, invoke them, and assert against snapshot files

Changes

  • .github/workflows/tests.yml new workflow: unit-test job (container matrix) +
    integration-test job (build → ECR push → Lambda deploy → invoke → assert → cleanup)
  • ci/integ/ new helper scripts: install-deps.sh, unit-test.sh, invoke.sh, assert.sh, and 4
    Dockerfiles (al2023, alpine, arch, ubuntu)
  • tests/ replace vendored gtest + integration tests with a snapshot-based approach using
    lambda_function.cpp multi-handler binary
  • ci/codebuild/, ci/docker/, ci/update-images.sh, ci/README.md deleted (superseded by GHA)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


// Read the handler from the environment variable
const char* handler_name = std::getenv("_HANDLER");
const char* handler_name = std::getenv("HANDLER");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

_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);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread tests/CMakeLists.txt
endif()


find_package(AWSSDK COMPONENTS lambda iam QUIET)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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)

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