Skip to content

Add end-to-end integration tests#619

Open
fabisev wants to merge 5 commits into
mainfrom
fabisev/integration-tests
Open

Add end-to-end integration tests#619
fabisev wants to merge 5 commits into
mainfrom
fabisev/integration-tests

Conversation

@fabisev

@fabisev fabisev commented Jun 29, 2026

Copy link
Copy Markdown

Add end-to-end integration tests for aws-lambda-java-log4j2
Adds integration tests that deploy a Lambda function using aws-lambda-java-log4j2, invoke it, and verify logs arrive in CloudWatch. This catches the main regression path: Log4j2 plugin discovery failing due to a missing Log4j2Plugins.dat in the shaded JAR.

  • lambda-integration-tests/ - SAM project with a minimal Java Lambda function that logs a unique marker at INFO/DEBUG/WARN/ERROR levels via Log4j2 LambdaAppender
  • run-tests.sh - invokes the function and polls CloudWatch to verify the marker arrived
  • build-integration-test.yml - PR gate that verifies the test function compiles
  • run-integration-test.yml - deploys to AWS, runs the test, cleans up

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

workflow_dispatch:
push:
branches: [ main ]
paths:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here the test should be run for most packages, at least the one that are involved.

core, serialization, runtime-interface-client, log4j and i would also add events.

Comment thread .github/workflows/build-integration-test.yml
- uses: actions/checkout@v6

- name: Set up JDK
uses: actions/setup-java@v5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here and in all other references to github actions.

Comment thread .github/workflows/run-integration-test.yml
group: integration-test
cancel-in-progress: false
steps:
- uses: actions/checkout@v6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add the commit sha to prevent supply chain attacks.

# integration test script for aws-lambda-java-log4j2.
# invokes the deployed lambda function and verifies logs appear in CloudWatch.

set -euo pipefail

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the moment it's sufficient like this but we probably can do something more advanced. For example we can create a Java project that uses a something like JUNIT to run the AWS SDK invoke the function and then get the logs.

In this way we avoid doing scripting and we can also have a nice report for how the test has gone.


- name: Install log4j2 with Maven
run: |
export JAVA_HOME=$JAVA_HOME_8_X64

@maxday maxday Jun 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's make sure we run integ test on both architectures. You can use a matrix job to do this (ie: https://github.com/aws/aws-lambda-ruby-runtime-interface-client/blob/main/.github/workflows/integration-tests.yml#L32)

@darklight3it darklight3it left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

@fabisev fabisev force-pushed the fabisev/integration-tests branch from 39f30ee to 0e35558 Compare July 1, 2026 13:54
@fabisev fabisev force-pushed the fabisev/integration-tests branch from f78d3ce to cb9c4f6 Compare July 1, 2026 14:32
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.

3 participants