Skip to content

chore(ci): Add GraalVM E2E tests and GH workflows #1945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 21, 2025
Merged

Conversation

phipag
Copy link
Contributor

@phipag phipag commented Jul 18, 2025

Summary

This PR introduces E2E tests for testing against native images deployed on AL2023.provided runtime compiled using GraalVM.

It is important to have these tests to cover regressions of future code changes. For example, if the GraalVM metadata files were not updated inline with new code changes. We want to protect customers from releasing changes that break GraalVM compatibility.

Tests pass ✅

Changes

The GraalVM E2E tests are triggered by a custom e2e-graal maven profile which sets a System Property graalvm.enabled = true. This will be read within the E2E infrastructure logic to decide whether to deploy a native image on the Lambda provided runtime or not. The E2E test assertions themselves stay untouched because we expect the exact same output for native images like for JVM based Lambda handlers. We can include more utilities in GraalVM E2E tests as we grow the GraalVM support across more Powertools utilities by updating this maven profile configuration.

 <configuration>
      <skipAfterFailureCount>1</skipAfterFailureCount>
      <includes>
          <!-- Add additional E2E tests here when adding new GraalVM support to utilities. -->
          <include>**/MetricsE2ET.java</include>
          <include>**/LoggingE2ET.java</include>
          <include>**/ParametersE2ET.java</include>
      </includes>
      <excludes>
          <exclude>**/TracingE2ET.java</exclude>
      </excludes>
      <systemPropertyVariables>
          <graalvm.enabled>true</graalvm.enabled>
      </systemPropertyVariables>
  </configuration>
  • Update GitHub action workflow to include e2e-graal job running the same Java matrix and same workflows like e2e
  • Update E2E test handlers to include GraalVM metadata files required to run as native image (this will be same experience like an end user would do when deploying a Lambda handler)
  • Update Infrastructure configuration to be compatible with GraalVM
    • Introduced new DockerConfiguration.java to hold configuration for CDK Bundling within Docker. Required for x86 cross-compilation of native image.

Issue number: #1803


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@phipag
Copy link
Contributor Author

phipag commented Jul 18, 2025

I don't understand why the osv-scanner fails since this vulnerability was not introduced by this PR. According to the docs it should only scan the PR diff. https://google.github.io/osv-scanner/github-action/#scan-on-pull-request

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Hey @phipag great job! Some few comments to address before we merge it.

Copy link

@phipag
Copy link
Contributor Author

phipag commented Jul 21, 2025

Thanks for your feedback @leandrodamascena, I addressed your comments.

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all the comments @phipag! Ship it!

Approved!

@phipag phipag merged commit 78fab52 into main Jul 21, 2025
14 of 16 checks passed
@phipag phipag deleted the phipag/graalvm-e2e branch July 21, 2025 11:07
@github-project-automation github-project-automation bot moved this from Pending review to Coming soon in Powertools for AWS Lambda (Java) Jul 21, 2025
@phipag phipag linked an issue Jul 21, 2025 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Coming soon
Development

Successfully merging this pull request may close these issues.

2 participants