Skip to content

Commit 0de3034

Browse files
authored
chore: E2E tests GitHub action (#1175)
1 parent 68d6a49 commit 0de3034

File tree

4 files changed

+54
-4
lines changed

4 files changed

+54
-4
lines changed

.github/workflows/run-e2e-tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run end-to-end tests
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches: [main]
8+
paths: # add other modules when there are under e2e tests
9+
- 'powertools-e2e-tests/**'
10+
- 'powertools-core/**'
11+
- 'powertools-serialization/**'
12+
- 'powertools-logging/**'
13+
- 'powertools-tracing/**'
14+
- 'powertools-idempotency/**'
15+
- 'powertools-parameters/**'
16+
- 'powertools-metrics/**'
17+
- 'pom.xml'
18+
- '.github/workflows/**'
19+
20+
jobs:
21+
e2e:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
max-parallel: 3
25+
matrix:
26+
java: [ 8, 11, 17 ]
27+
name: End-to-end tests java${{ matrix.java }}
28+
env:
29+
JAVA_VERSION: ${{ matrix.java }}
30+
AWS_DEFAULT_REGION: eu-west-1
31+
permissions:
32+
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
33+
contents: read
34+
steps:
35+
- uses: actions/checkout@v3
36+
- name: Setup java
37+
uses: actions/setup-java@v3
38+
with:
39+
distribution: 'corretto'
40+
java-version: ${{ matrix.java }}
41+
cache: maven
42+
- name: Setup AWS credentials
43+
uses: aws-actions/configure-aws-credentials@v1.6.1
44+
with:
45+
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
46+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
47+
- name: Run e2e test with Maven
48+
run: mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
<dependency>
297297
<groupId>ch.qos.logback</groupId>
298298
<artifactId>logback-classic</artifactId>
299-
<version>1.4.7</version>
299+
<version>1.3.8</version>
300300
<scope>test</scope>
301301
</dependency>
302302
<dependency>

powertools-e2e-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<dependency>
3030
<groupId>ch.qos.logback</groupId>
3131
<artifactId>logback-classic</artifactId>
32-
<version>1.4.7</version>
32+
<version>1.3.8</version>
3333
</dependency>
3434

3535
<dependency>

powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/IdempotencyE2ET.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import java.time.Year;
1212
import java.util.Collections;
13+
import java.util.UUID;
1314
import java.util.concurrent.TimeUnit;
1415

1516
import static software.amazon.lambda.powertools.testutils.lambda.LambdaInvoker.invokeFunction;
@@ -21,11 +22,12 @@ public class IdempotencyE2ET {
2122
@BeforeAll
2223
@Timeout(value = 5, unit = TimeUnit.MINUTES)
2324
public static void setup() {
25+
String random = UUID.randomUUID().toString().substring(0, 6);
2426
infrastructure = Infrastructure.builder()
2527
.testName(IdempotencyE2ET.class.getSimpleName())
2628
.pathToFunction("idempotency")
27-
.idempotencyTable("idempo")
28-
.environmentVariables(Collections.singletonMap("IDEMPOTENCY_TABLE", "idempo"))
29+
.idempotencyTable("idempo" + random)
30+
.environmentVariables(Collections.singletonMap("IDEMPOTENCY_TABLE", "idempo" + random))
2931
.build();
3032
functionName = infrastructure.deploy();
3133
}

0 commit comments

Comments
 (0)