Skip to content

Commit 5e8677c

Browse files
committed
update workflows. filter e2e tests from build. Add trait Category=E2E for e2e tests
1 parent 28c122d commit 5e8677c

File tree

7 files changed

+41
-24
lines changed

7 files changed

+41
-24
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Test Examples
3131
run: dotnet test ../examples/
3232
- name: Test & Code Coverage
33-
run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./codecov --verbosity normal
33+
run: dotnet test --filter "Category!=E2E" --collect:"XPlat Code Coverage" --results-directory ./codecov --verbosity normal
3434
- name: Codecov
3535
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # 4.5.0
3636
with:

.github/workflows/e2e-infra-deploy.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: E2E Tests Infra deployment
1+
# PROCESS
2+
#
3+
# 1. Deploy the core stack using AWS CDK.
4+
# 2. Deploy the AOT stack using AWS CDK.
5+
6+
# USAGE
7+
#
8+
# This workflow is used by the E2E Tests workflow to deploy the necessary infrastructure.
29

3-
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- develop
10+
name: E2E Tests Infra deployment
811

912
permissions:
1013
id-token: write
@@ -13,23 +16,20 @@ permissions:
1316
jobs:
1417
deploy-core-stack:
1518
runs-on: aws-powertools_ubuntu-latest_8-core
16-
strategy:
17-
matrix:
18-
dotnet-version: [ 6.x, 8.x ]
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
2222

2323
- name: Configure AWS credentials
2424
uses: aws-actions/configure-aws-credentials@v2
2525
with:
26-
role-to-assume: arn:aws:iam::YOUR_AWS_ACCOUNT_ID:role/YOUR_ROLE_NAME
26+
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
2727
aws-region: us-east-1
2828

2929
- name: Set up .NET
3030
uses: actions/setup-dotnet@v4
3131
with:
32-
dotnet-version: ${{ matrix.dotnet-version }}
32+
dotnet-version: '8.x'
3333

3434
- name: Install CDK
3535
run: npm install -g aws-cdk
@@ -38,7 +38,7 @@ jobs:
3838
run: |
3939
cd libraries/tests/e2e/infra
4040
cdk deploy --require-approval never
41-
41+
4242
deploy-aot-stack:
4343
runs-on: aws-powertools_ubuntu-latest_8-core
4444
strategy:
@@ -53,7 +53,7 @@ jobs:
5353
- name: Configure AWS credentials
5454
uses: aws-actions/configure-aws-credentials@v2
5555
with:
56-
role-to-assume: arn:aws:iam::YOUR_AWS_ACCOUNT_ID:role/YOUR_ROLE_NAME
56+
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
5757
aws-region: us-east-1
5858

5959
- name: Set up .NET

.github/workflows/e2e-infra-destroy.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: Destroy e2e CDK Stacks
1+
# PROCESS
2+
#
3+
# 1. Destroy the core stack using AWS CDK.
4+
# 2. Destroy the AOT stack using AWS CDK.
5+
6+
# USAGE
7+
#
8+
# This workflow is used by the E2E Tests workflow to destroy the infrastructure after tests are completed.
29

3-
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- develop
10+
name: Destroy e2e CDK Stacks
811

912
permissions:
1013
id-token: write
@@ -24,7 +27,7 @@ jobs:
2427
- name: Configure AWS credentials
2528
uses: aws-actions/configure-aws-credentials@v2
2629
with:
27-
role-to-assume: arn:aws:iam::YOUR_AWS_ACCOUNT_ID:role/YOUR_ROLE_NAME
30+
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
2831
aws-region: us-east-1
2932

3033
- name: Install CDK

.github/workflows/e2e-tests.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# PROCESS
2+
#
3+
# 1. Deploy the core and AOT stacks using the infra deployment workflow.
4+
# 2. Run the E2E tests after the infrastructure is deployed.
5+
# 3. Destroy the CDK stacks after the tests are completed.
6+
7+
# USAGE
8+
#
9+
# This workflow is triggered on push to the develop branch or manually via workflow_dispatch.
10+
111
name: E2E Tests
212

313
on:
@@ -16,10 +26,11 @@ jobs:
1626

1727
deploy-aot-stack:
1828
uses: ./.github/workflows/e2e-infra-deploy.yml
19-
29+
2030
run-tests:
2131
runs-on: aws-powertools_ubuntu-latest_8-core
22-
needs: [deploy-core-stack, deploy-aot-stack]
32+
# needs: [deploy-core-stack, deploy-aot-stack]
33+
needs: [deploy-core-stack]
2334
steps:
2435
- name: Checkout code
2536
uses: actions/checkout@v4
@@ -32,4 +43,4 @@ jobs:
3243
- name: Run Core Tests
3344
run: |
3445
cd libraries/tests/e2e/functions/core
35-
dotnet test
46+
dotnet test

libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace Function.Tests;
1010

11+
[Trait("Category", "E2E")]
1112
public class FunctionTest
1213
{
1314
private readonly ITestOutputHelper _testOutputHelper;

libraries/tests/e2e/functions/core/metrics/Function/test/Function.Tests/FunctionTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace Function.Tests;
1010

11+
[Trait("Category", "E2E")]
1112
public class FunctionTest
1213
{
1314
private readonly ITestOutputHelper _testOutputHelper;

libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace Function.Tests;
1010

11+
[Trait("Category", "E2E")]
1112
public class FunctionTest
1213
{
1314
private readonly ITestOutputHelper _testOutputHelper;

0 commit comments

Comments
 (0)