Add end-to-end integration tests#619
Conversation
| workflow_dispatch: | ||
| push: | ||
| branches: [ main ] | ||
| paths: |
There was a problem hiding this comment.
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.
| # this workflow verifies that the integration test Lambda function builds successfully. | ||
| # it does NOT deploy or run the tests (that requires AWS credentials and is done in | ||
| # run-integration-test.yml). |
There was a problem hiding this comment.
Aren't those supposed to fail as well in the run-integration-test. It seems to me that those test s are rebuilt also there.
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v5 |
There was a problem hiding this comment.
Same here and in all other references to github actions.
|
|
||
| - name: Install log4j2 with Maven | ||
| run: | | ||
| export JAVA_HOME=$JAVA_HOME_8_X64 |
There was a problem hiding this comment.
It's probably correct here. But it is not correct in general.
In Java we have some C++ component that are dependent on the architecture. We should have a look at that together.
The test should be run per arch and probably runtime (I was doing a CR also for that). For the moment it's probably fine.
We should also do this #617
| group: integration-test | ||
| cancel-in-progress: false | ||
| steps: | ||
| - uses: actions/checkout@v6 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
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.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.