Skip to content

Commit 78fab52

Browse files
authored
chore(ci): Add GraalVM E2E tests and GH workflows (#1945)
* Add GraalVM support for E2E tests starting with metrics handler. * Add GraalVM E2E test support for Logging and Parameters. Refactor metrics configuration be in parent pom. * Add e2e-graal step to e2e test workflow. * Disable maven download progress logs to reduce amount of logs in GH runner. * Fix sonarlint issue. * Update osv-scanner to 2.1.0. * PIN docker image version. * Add fail-fast: false option to GH workflow.
1 parent 08c9db8 commit 78fab52

File tree

39 files changed

+1003
-91
lines changed

39 files changed

+1003
-91
lines changed

.github/workflows/check-e2e.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
id-token: write
4848
environment: E2E
4949
strategy:
50+
fail-fast: false
5051
max-parallel: 3
5152
matrix:
5253
java:
@@ -70,4 +71,37 @@ jobs:
7071
- name: Run e2e test with Maven
7172
env:
7273
JAVA_VERSION: ${{ matrix.java }}
73-
run: mvn -DskipTests install --file pom.xml && mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
74+
run: mvn -DskipTests -ntp install --file pom.xml && mvn -Pe2e -B -ntp verify --file powertools-e2e-tests/pom.xml
75+
76+
e2e-graal:
77+
name: End-to-end GraalVM Tests (Java ${{ matrix.java }})
78+
runs-on: ubuntu-latest
79+
permissions:
80+
id-token: write
81+
environment: E2E
82+
strategy:
83+
fail-fast: false
84+
max-parallel: 3
85+
matrix:
86+
java:
87+
- 11
88+
- 17
89+
- 21
90+
91+
steps:
92+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
93+
- name: Setup java
94+
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
95+
with:
96+
distribution: 'corretto'
97+
java-version: ${{ matrix.java }}
98+
cache: maven
99+
- name: Setup AWS credentials
100+
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
101+
with:
102+
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
103+
aws-region: us-east-1
104+
- name: Run e2e-graal test with Maven
105+
env:
106+
JAVA_VERSION: ${{ matrix.java }}
107+
run: mvn -DskipTests -ntp install --file pom.xml && mvn -Pe2e-graal -B -ntp verify --file powertools-e2e-tests/pom.xml

.github/workflows/security-osv.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
actions: read
3333
contents: read
3434
security-events: write
35-
uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@764c91816374ff2d8fc2095dab36eecd42d61638 # v1.9.2
35+
uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@b00f71e051ddddc6e46a193c31c8c0bf283bf9e6 # v2.1.0

powertools-e2e-tests/handlers/logging/pom.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44

55
<parent>
@@ -30,6 +30,14 @@
3030
<groupId>com.amazonaws</groupId>
3131
<artifactId>aws-lambda-java-events</artifactId>
3232
</dependency>
33+
<dependency>
34+
<groupId>com.amazonaws</groupId>
35+
<artifactId>aws-lambda-java-runtime-interface-client</artifactId>
36+
</dependency>
37+
<dependency>
38+
<groupId>com.amazonaws</groupId>
39+
<artifactId>aws-lambda-java-core</artifactId>
40+
</dependency>
3341
</dependencies>
3442

3543
<build>
@@ -62,4 +70,18 @@
6270
</plugin>
6371
</plugins>
6472
</build>
73+
74+
<profiles>
75+
<profile>
76+
<id>native-image</id>
77+
<build>
78+
<plugins>
79+
<plugin>
80+
<groupId>org.graalvm.buildtools</groupId>
81+
<artifactId>native-maven-plugin</artifactId>
82+
</plugin>
83+
</plugins>
84+
</build>
85+
</profile>
86+
</profiles>
6587
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
{
3+
"name":"com.amazonaws.services.lambda.runtime.LambdaRuntime",
4+
"methods":[{"name":"<init>","parameterTypes":[] }],
5+
"fields":[{"name":"logger"}],
6+
"allPublicMethods":true
7+
},
8+
{
9+
"name":"com.amazonaws.services.lambda.runtime.LambdaRuntimeInternal",
10+
"methods":[{"name":"<init>","parameterTypes":[] }],
11+
"allPublicMethods":true
12+
}
13+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[
2+
{
3+
"name": "com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent",
4+
"allDeclaredFields": true,
5+
"allDeclaredMethods": true,
6+
"allDeclaredConstructors": true
7+
},
8+
{
9+
"name": "com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent$ProxyRequestContext",
10+
"allDeclaredFields": true,
11+
"allDeclaredMethods": true,
12+
"allDeclaredConstructors": true
13+
},
14+
{
15+
"name": "com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent$RequestIdentity",
16+
"allDeclaredFields": true,
17+
"allDeclaredMethods": true,
18+
"allDeclaredConstructors": true
19+
},
20+
{
21+
"name": "com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent",
22+
"allDeclaredFields": true,
23+
"allDeclaredMethods": true,
24+
"allDeclaredConstructors": true
25+
},
26+
{
27+
"name": "com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent",
28+
"allDeclaredConstructors": true,
29+
"allPublicConstructors": true,
30+
"allDeclaredMethods": true,
31+
"allPublicMethods": true,
32+
"allDeclaredClasses": true,
33+
"allPublicClasses": true
34+
}
35+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"name":"com.amazonaws.services.lambda.runtime.api.client.runtimeapi.LambdaRuntimeClientException",
4+
"methods":[{"name":"<init>","parameterTypes":["java.lang.String","int"] }]
5+
},
6+
{
7+
"name":"com.amazonaws.services.lambda.runtime.api.client.runtimeapi.dto.InvocationRequest",
8+
"fields":[{"name":"id"}, {"name":"invokedFunctionArn"}, {"name":"deadlineTimeInMs"}, {"name":"xrayTraceId"}, {"name":"clientContext"}, {"name":"cognitoIdentity"}, {"name": "tenantId"}, {"name":"content"}],
9+
"allPublicMethods":true
10+
}
11+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Args = --initialize-at-build-time=jdk.xml.internal.SecuritySupport
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[
2+
{
3+
"name": "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.deser.Deserializers[]"
4+
},
5+
{
6+
"name": "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.ext.Java7SupportImpl",
7+
"methods": [{ "name": "<init>", "parameterTypes": [] }]
8+
},
9+
{
10+
"name": "com.amazonaws.services.lambda.runtime.LambdaRuntime",
11+
"fields": [{ "name": "logger" }]
12+
},
13+
{
14+
"name": "com.amazonaws.services.lambda.runtime.logging.LogLevel",
15+
"allDeclaredConstructors": true,
16+
"allPublicConstructors": true,
17+
"allDeclaredMethods": true,
18+
"allPublicMethods": true,
19+
"allDeclaredFields": true,
20+
"allPublicFields": true
21+
},
22+
{
23+
"name": "com.amazonaws.services.lambda.runtime.logging.LogFormat",
24+
"allDeclaredConstructors": true,
25+
"allPublicConstructors": true,
26+
"allDeclaredMethods": true,
27+
"allPublicMethods": true,
28+
"allDeclaredFields": true,
29+
"allPublicFields": true
30+
},
31+
{
32+
"name": "java.lang.Void",
33+
"methods": [{ "name": "<init>", "parameterTypes": [] }]
34+
},
35+
{
36+
"name": "java.util.Collections$UnmodifiableMap",
37+
"fields": [{ "name": "m" }]
38+
},
39+
{
40+
"name": "jdk.internal.module.IllegalAccessLogger",
41+
"fields": [{ "name": "logger" }]
42+
},
43+
{
44+
"name": "sun.misc.Unsafe",
45+
"fields": [{ "name": "theUnsafe" }]
46+
},
47+
{
48+
"name": "com.amazonaws.services.lambda.runtime.api.client.runtimeapi.dto.InvocationRequest",
49+
"fields": [
50+
{ "name": "id" },
51+
{ "name": "invokedFunctionArn" },
52+
{ "name": "deadlineTimeInMs" },
53+
{ "name": "xrayTraceId" },
54+
{ "name": "clientContext" },
55+
{ "name": "cognitoIdentity" },
56+
{ "name": "tenantId" },
57+
{ "name": "content" }
58+
],
59+
"allPublicMethods": true
60+
}
61+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"resources": {
3+
"includes": [
4+
{
5+
"pattern": "\\Qjni/libaws-lambda-jni.linux-aarch_64.so\\E"
6+
},
7+
{
8+
"pattern": "\\Qjni/libaws-lambda-jni.linux-x86_64.so\\E"
9+
},
10+
{
11+
"pattern": "\\Qjni/libaws-lambda-jni.linux_musl-aarch_64.so\\E"
12+
},
13+
{
14+
"pattern": "\\Qjni/libaws-lambda-jni.linux_musl-x86_64.so\\E"
15+
}
16+
]
17+
},
18+
"bundles": []
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[
2+
{
3+
"name": "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.deser.Deserializers[]"
4+
},
5+
{
6+
"name": "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.ext.Java7HandlersImpl",
7+
"methods": [{ "name": "<init>", "parameterTypes": [] }]
8+
},
9+
{
10+
"name": "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.ext.Java7SupportImpl",
11+
"methods": [{ "name": "<init>", "parameterTypes": [] }]
12+
},
13+
{
14+
"name": "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.ser.Serializers[]"
15+
},
16+
{
17+
"name": "org.joda.time.DateTime",
18+
"allDeclaredConstructors": true,
19+
"allPublicConstructors": true,
20+
"allDeclaredMethods": true,
21+
"allPublicMethods": true,
22+
"allDeclaredClasses": true,
23+
"allPublicClasses": true
24+
}
25+
]

0 commit comments

Comments
 (0)