Skip to content

chore: E2E tests GitHub action #1175

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 18 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run end-to-end tests

on:
workflow_dispatch:

push:
branches: [main]
paths: # add other modules when there are under e2e tests
- 'powertools-e2e-tests/**'
- 'powertools-core/**'
- 'powertools-serialization/**'
- 'powertools-logging/**'
- 'powertools-tracing/**'
- 'powertools-idempotency/**'
- 'powertools-parameters/**'
- 'powertools-metrics/**'
- 'pom.xml'
- '.github/workflows/**'

jobs:
e2e:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
java: [ 8, 11, 17 ]
name: End-to-end tests java${{ matrix.java }}
env:
JAVA_VERSION: ${{ matrix.java }}
AWS_DEFAULT_REGION: eu-west-1
permissions:
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
contents: read
steps:
- uses: actions/checkout@v3
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: ${{ matrix.java }}
cache: maven
- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@v1.6.1
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Run e2e test with Maven
run: mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.7</version>
<version>1.3.8</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion powertools-e2e-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.7</version>
<version>1.3.8</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.time.Year;
import java.util.Collections;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

import static software.amazon.lambda.powertools.testutils.lambda.LambdaInvoker.invokeFunction;
Expand All @@ -21,11 +22,12 @@ public class IdempotencyE2ET {
@BeforeAll
@Timeout(value = 5, unit = TimeUnit.MINUTES)
public static void setup() {
String random = UUID.randomUUID().toString().substring(0, 6);
infrastructure = Infrastructure.builder()
.testName(IdempotencyE2ET.class.getSimpleName())
.pathToFunction("idempotency")
.idempotencyTable("idempo")
.environmentVariables(Collections.singletonMap("IDEMPOTENCY_TABLE", "idempo"))
.idempotencyTable("idempo" + random)
.environmentVariables(Collections.singletonMap("IDEMPOTENCY_TABLE", "idempo" + random))
.build();
functionName = infrastructure.deploy();
}
Expand Down