From aada5c826e3de3977ac96bf47c1547e74b36d783 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:57:42 +0000 Subject: [PATCH 01/21] add workflow_call: --- .github/workflows/e2e-infra-deploy.yml | 3 +++ .github/workflows/e2e-infra-destroy.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/e2e-infra-deploy.yml b/.github/workflows/e2e-infra-deploy.yml index 1ee5b2d3..b1c67b77 100644 --- a/.github/workflows/e2e-infra-deploy.yml +++ b/.github/workflows/e2e-infra-deploy.yml @@ -9,6 +9,9 @@ name: E2E Tests Infra deployment +on: + workflow_call: + permissions: id-token: write contents: read diff --git a/.github/workflows/e2e-infra-destroy.yml b/.github/workflows/e2e-infra-destroy.yml index 561f8b97..9d378cc9 100644 --- a/.github/workflows/e2e-infra-destroy.yml +++ b/.github/workflows/e2e-infra-destroy.yml @@ -9,6 +9,9 @@ name: Destroy e2e CDK Stacks +on: + workflow_call: + permissions: id-token: write contents: read From 5de923d829d319e9acb7abad75661a7d471eaf52 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:01:10 +0000 Subject: [PATCH 02/21] update --- .github/workflows/e2e-infra-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e-infra-deploy.yml b/.github/workflows/e2e-infra-deploy.yml index b1c67b77..53b68a3d 100644 --- a/.github/workflows/e2e-infra-deploy.yml +++ b/.github/workflows/e2e-infra-deploy.yml @@ -11,6 +11,7 @@ name: E2E Tests Infra deployment on: workflow_call: + permissions: id-token: write From e3f89b5aafcdbcbc931d48140d114afa17b0a75f Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:31:53 +0000 Subject: [PATCH 03/21] change runner --- .github/workflows/e2e-infra-deploy.yml | 2 +- .github/workflows/e2e-infra-destroy.yml | 2 +- .github/workflows/e2e-tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-infra-deploy.yml b/.github/workflows/e2e-infra-deploy.yml index 18d17a2c..d2bef676 100644 --- a/.github/workflows/e2e-infra-deploy.yml +++ b/.github/workflows/e2e-infra-deploy.yml @@ -18,7 +18,7 @@ permissions: jobs: deploy-core-stack: - runs-on: aws-powertools_ubuntu-latest_8-core + runs-on: ubuntu-latest permissions: id-token: write contents: read diff --git a/.github/workflows/e2e-infra-destroy.yml b/.github/workflows/e2e-infra-destroy.yml index 87e9198a..3490995b 100644 --- a/.github/workflows/e2e-infra-destroy.yml +++ b/.github/workflows/e2e-infra-destroy.yml @@ -18,7 +18,7 @@ permissions: jobs: destroy-stacks: - runs-on: aws-powertools_ubuntu-latest_8-core + runs-on: ubuntu-latest permissions: id-token: write contents: read diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 211b867a..4d14cdaf 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -30,7 +30,7 @@ jobs: run-tests: - runs-on: aws-powertools_ubuntu-latest_8-core + runs-on: ubuntu-latest permissions: id-token: write contents: read From 137e25a7a5c705f0bd941e249197d9b2c2ac64ba Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:37:41 +0000 Subject: [PATCH 04/21] remove read --- .github/workflows/e2e-infra-deploy.yml | 1 - .github/workflows/e2e-tests.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/e2e-infra-deploy.yml b/.github/workflows/e2e-infra-deploy.yml index d2bef676..f22d2556 100644 --- a/.github/workflows/e2e-infra-deploy.yml +++ b/.github/workflows/e2e-infra-deploy.yml @@ -13,7 +13,6 @@ on: workflow_call: permissions: - id-token: read contents: read jobs: diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 4d14cdaf..3f5b38e6 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -17,7 +17,6 @@ on: - develop permissions: - id-token: read contents: read jobs: From c47815be857cdf2063cf704a87efcbe4a244952d Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:44:33 +0000 Subject: [PATCH 05/21] add permission --- .github/workflows/e2e-infra-deploy.yml | 1 + .github/workflows/e2e-tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/e2e-infra-deploy.yml b/.github/workflows/e2e-infra-deploy.yml index f22d2556..9ca87c34 100644 --- a/.github/workflows/e2e-infra-deploy.yml +++ b/.github/workflows/e2e-infra-deploy.yml @@ -13,6 +13,7 @@ on: workflow_call: permissions: + id-token: write contents: read jobs: diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 3f5b38e6..85e392ab 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -17,6 +17,7 @@ on: - develop permissions: + id-token: write contents: read jobs: From a256eba75bf35419055b2dd5ec56bad58b73b474 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:55:36 +0000 Subject: [PATCH 06/21] move deploy inline --- .github/workflows/e2e-tests.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 85e392ab..2569bc33 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -22,21 +22,18 @@ permissions: jobs: - deploy-core-stack: - permissions: - id-token: write - contents: read - uses: ./.github/workflows/e2e-infra-deploy.yml - - run-tests: runs-on: ubuntu-latest permissions: id-token: write contents: read # needs: [deploy-core-stack, deploy-aot-stack] - needs: [deploy-core-stack] +# needs: [deploy-core-stack] steps: + + - name: Deploy Stack + uses: ./.github/workflows/e2e-infra-deploy.yml + - name: Checkout code uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -53,7 +50,7 @@ jobs: cd libraries/tests/e2e/functions/core dotnet test - - name: Destroy Core Stack + - name: Destroy Stack if: always() uses: ./.github/workflows/e2e-infra-destroy.yml From f781f1af55eac1db1bac30ac75797e7a8ae4ea15 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:18:23 +0000 Subject: [PATCH 07/21] refactor and move all to the same file --- .github/workflows/e2e-infra-deploy.yml | 82 --------------------- .github/workflows/e2e-infra-destroy.yml | 46 ------------ .github/workflows/e2e-tests.yml | 94 +++++++++++++++++-------- 3 files changed, 63 insertions(+), 159 deletions(-) delete mode 100644 .github/workflows/e2e-infra-deploy.yml delete mode 100644 .github/workflows/e2e-infra-destroy.yml diff --git a/.github/workflows/e2e-infra-deploy.yml b/.github/workflows/e2e-infra-deploy.yml deleted file mode 100644 index 9ca87c34..00000000 --- a/.github/workflows/e2e-infra-deploy.yml +++ /dev/null @@ -1,82 +0,0 @@ -# PROCESS -# -# 1. Deploy the core stack using AWS CDK. -# 2. Deploy the AOT stack using AWS CDK. - -# USAGE -# -# This workflow is used by the E2E Tests workflow to deploy the necessary infrastructure. - -name: E2E Tests Infra deployment - -on: - workflow_call: - -permissions: - id-token: write - contents: read - -jobs: - deploy-core-stack: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - steps: - - name: Checkout code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 - with: - role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} - aws-region: us-east-1 - mask-aws-account-id: true - - - name: Set up .NET - uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 - with: - dotnet-version: '8.x' - - - name: Setup Node.js - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 - with: - node-version: "20.10.0" - - - name: Install CDK - run: npm install -g aws-cdk - - - name: Deploy Core Stack - run: | - cd libraries/tests/e2e/infra - cdk deploy --require-approval never - - # deploy-aot-stack: - # runs-on: aws-powertools_ubuntu-latest_8-core - # strategy: - # matrix: - # architecture: [ x86_64, arm64 ] - # container: - # image: public.ecr.aws/sam/build-dotnet8:latest - # steps: - # - name: Checkout code - # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - # - name: Configure AWS credentials - # uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef - # with: - # role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} - # aws-region: us-east-1 - - # - name: Set up .NET - # uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 - # with: - # dotnet-version: '8.x' - - # - name: Install CDK - # run: npm install -g aws-cdk - - # - name: Deploy AOT Stack - # run: | - # cd libraries/tests/e2e/infra-aot - # cdk deploy --require-approval never diff --git a/.github/workflows/e2e-infra-destroy.yml b/.github/workflows/e2e-infra-destroy.yml deleted file mode 100644 index 3490995b..00000000 --- a/.github/workflows/e2e-infra-destroy.yml +++ /dev/null @@ -1,46 +0,0 @@ -# PROCESS -# -# 1. Destroy the core stack using AWS CDK. -# 2. Destroy the AOT stack using AWS CDK. - -# USAGE -# -# This workflow is used by the E2E Tests workflow to destroy the infrastructure after tests are completed. - -name: Destroy e2e CDK Stacks - -on: - workflow_call: - -permissions: - id-token: read - contents: read - -jobs: - destroy-stacks: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - steps: - - name: Checkout code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef - with: - role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} - aws-region: us-east-1 - - - name: Install CDK - run: npm install -g aws-cdk - - - name: Destroy Core Stack - run: | - cd libraries/tests/e2e/infra - cdk destroy --force - - - name: Destroy AOT Stack - run: | - cd libraries/tests/e2e/infra-aot - cdk destroy --force diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 2569bc33..3c2bae68 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -21,39 +21,71 @@ permissions: contents: read jobs: + deploy-stack: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 + with: + role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} + aws-region: us-east-1 + mask-aws-account-id: true + + - name: Set up .NET + uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 + with: + dotnet-version: '8.x' + + - name: Install CDK + run: npm install -g aws-cdk + + - name: Deploy Core Stack + run: | + cd libraries/tests/e2e/infra + cdk deploy --require-approval never run-tests: runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - # needs: [deploy-core-stack, deploy-aot-stack] -# needs: [deploy-core-stack] + needs: deploy-stack + steps: + - name: Checkout code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + + - name: Set up .NET + uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 + with: + dotnet-version: '8.x' + + - name: Install AWS Lambda .NET CLI Tools + run: dotnet tool install -g Amazon.Lambda.Tools + + - name: Run Core Tests + run: | + cd libraries/tests/e2e/functions/core + dotnet test + + destroy-stack: + runs-on: ubuntu-latest + needs: run-tests + if: always() steps: + - name: Checkout code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 + with: + role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} + aws-region: us-east-1 + mask-aws-account-id: true + + - name: Install CDK + run: npm install -g aws-cdk - - name: Deploy Stack - uses: ./.github/workflows/e2e-infra-deploy.yml - - - name: Checkout code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - - name: Set up .NET - uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 - with: - dotnet-version: '8.x' - - - name: Install AWS Lambda .NET CLI Tools - run: dotnet tool install -g Amazon.Lambda.Tools - - - name: Run Core Tests - run: | - cd libraries/tests/e2e/functions/core - dotnet test - - - name: Destroy Stack - if: always() - uses: ./.github/workflows/e2e-infra-destroy.yml - -# destroy-core-stack: -# needs: run-tests -# uses: ./.github/workflows/e2e-infra-destroy.yml + - name: Destroy Core Stack + run: | + cd libraries/tests/e2e/infra + cdk destroy --force From 8b39f2da5fe505f9a329898f4c2d08f9bfac0ce6 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:21:42 +0000 Subject: [PATCH 08/21] move dotnet-lambda to the deploy --- .github/workflows/e2e-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 3c2bae68..e3127452 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -42,6 +42,9 @@ jobs: - name: Install CDK run: npm install -g aws-cdk + - name: Install AWS Lambda .NET CLI Tools + run: dotnet tool install -g Amazon.Lambda.Tools + - name: Deploy Core Stack run: | cd libraries/tests/e2e/infra @@ -59,9 +62,6 @@ jobs: with: dotnet-version: '8.x' - - name: Install AWS Lambda .NET CLI Tools - run: dotnet tool install -g Amazon.Lambda.Tools - - name: Run Core Tests run: | cd libraries/tests/e2e/functions/core From 28279a21928fa45fb2543250d203d9ee68971072 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:27:44 +0000 Subject: [PATCH 09/21] setup aws cred in run tests --- .github/workflows/e2e-tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index e3127452..9536c5c1 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -57,6 +57,13 @@ jobs: - name: Checkout code uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 + with: + role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} + aws-region: us-east-1 + mask-aws-account-id: true + - name: Set up .NET uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 with: From 200befbe4084fe1a9d6474e0e68e5be711c0c2fe Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:28:38 +0000 Subject: [PATCH 10/21] add dotnet-lambda to destroy --- .github/workflows/e2e-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 9536c5c1..1616038c 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -91,6 +91,9 @@ jobs: - name: Install CDK run: npm install -g aws-cdk + + - name: Install AWS Lambda .NET CLI Tools + run: dotnet tool install -g Amazon.Lambda.Tools - name: Destroy Core Stack run: | From fd62f7a3897729c1ea2a143a387261993a3674ea Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:46:46 +0000 Subject: [PATCH 11/21] remove aot tests for now --- .../core/logging/Function/test/Function.Tests/FunctionTest.cs | 2 +- .../core/metrics/Function/test/Function.Tests/FunctionTest.cs | 2 +- .../core/tracing/Function/test/Function.Tests/FunctionTest.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs b/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs index 62b91ba7..a084b98e 100644 --- a/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs +++ b/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs @@ -25,7 +25,7 @@ public FunctionTest(ITestOutputHelper testOutputHelper) [InlineData("E2ETestLambda_ARM_NET6_logging")] [InlineData("E2ETestLambda_X64_NET8_logging")] [InlineData("E2ETestLambda_ARM_NET8_logging")] - [InlineData("E2ETestLambda_ARM_AOT_NET8_logging")] + // [InlineData("E2ETestLambda_ARM_AOT_NET8_logging")] public async Task TestFunction(string functionName) { var request = new InvokeRequest diff --git a/libraries/tests/e2e/functions/core/metrics/Function/test/Function.Tests/FunctionTest.cs b/libraries/tests/e2e/functions/core/metrics/Function/test/Function.Tests/FunctionTest.cs index cb164769..4ebda79c 100644 --- a/libraries/tests/e2e/functions/core/metrics/Function/test/Function.Tests/FunctionTest.cs +++ b/libraries/tests/e2e/functions/core/metrics/Function/test/Function.Tests/FunctionTest.cs @@ -25,7 +25,7 @@ public FunctionTest(ITestOutputHelper testOutputHelper) [InlineData("E2ETestLambda_ARM_NET6_metrics")] [InlineData("E2ETestLambda_X64_NET8_metrics")] [InlineData("E2ETestLambda_ARM_NET8_metrics")] - [InlineData("E2ETestLambda_ARM_AOT_NET8_metrics")] + // [InlineData("E2ETestLambda_ARM_AOT_NET8_metrics")] public async Task TestFunction(string functionName) { var request = new InvokeRequest diff --git a/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs b/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs index 7fd1b84b..9f60146e 100644 --- a/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs +++ b/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs @@ -25,7 +25,7 @@ public FunctionTest(ITestOutputHelper testOutputHelper) [InlineData("E2ETestLambda_ARM_NET6_tracing")] [InlineData("E2ETestLambda_X64_NET8_tracing")] [InlineData("E2ETestLambda_ARM_NET8_tracing")] - [InlineData("E2ETestLambda_ARM_AOT_NET8_tracing")] + // [InlineData("E2ETestLambda_ARM_AOT_NET8_tracing")] public async Task TestToUpperFunction(string functionName) { var request = new InvokeRequest From d505684fa1bb044e68228496b9593bc60df31cd4 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:28:25 +0000 Subject: [PATCH 12/21] fix tests --- .../test/Function.Tests/FunctionTest.cs | 24 ------------------- .../metrics/Function/src/Function/Function.cs | 3 ++- .../tests/e2e/functions/core/payload.json | 9 +------ .../test/Function.Tests/FunctionTest.cs | 5 +++- 4 files changed, 7 insertions(+), 34 deletions(-) diff --git a/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs b/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs index a084b98e..b20ef66a 100644 --- a/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs +++ b/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs @@ -114,30 +114,6 @@ private void AssertEventLog(string functionName, bool isColdStart, string output Assert.True(headersElement.TryGetProperty("Cache-Control", out JsonElement cacheControlElement)); Assert.Equal("max-age=0", cacheControlElement.GetString()); - Assert.True(headersElement.TryGetProperty("CloudFront-Forwarded-Proto", - out JsonElement cloudFrontForwardedProtoElement)); - Assert.Equal("https", cloudFrontForwardedProtoElement.GetString()); - - Assert.True(headersElement.TryGetProperty("CloudFront-Viewer-Country", - out JsonElement cloudFrontViewerCountryElement)); - Assert.Equal("US", cloudFrontViewerCountryElement.GetString()); - - Assert.True(headersElement.TryGetProperty("Upgrade-Insecure-Requests", - out JsonElement upgradeInsecureRequestsElement)); - Assert.Equal("1", upgradeInsecureRequestsElement.GetString()); - - Assert.True(headersElement.TryGetProperty("User-Agent", out JsonElement userAgentElement)); - Assert.Equal("Custom User Agent String", userAgentElement.GetString()); - - Assert.True(headersElement.TryGetProperty("X-Forwarded-For", out JsonElement xForwardedForElement)); - Assert.Equal("127.0.0.1, 127.0.0.2", xForwardedForElement.GetString()); - - Assert.True(headersElement.TryGetProperty("X-Forwarded-Port", out JsonElement xForwardedPortElement)); - Assert.Equal("443", xForwardedPortElement.GetString()); - - Assert.True(headersElement.TryGetProperty("X-Forwarded-Proto", out JsonElement xForwardedProtoElement)); - Assert.Equal("https", xForwardedProtoElement.GetString()); - Assert.True( messageElement.TryGetProperty("QueryStringParameters", out JsonElement queryStringParametersElement)); Assert.True(queryStringParametersElement.TryGetProperty("Foo", out JsonElement fooElement)); diff --git a/libraries/tests/e2e/functions/core/metrics/Function/src/Function/Function.cs b/libraries/tests/e2e/functions/core/metrics/Function/src/Function/Function.cs index 1ae9f606..021730e6 100644 --- a/libraries/tests/e2e/functions/core/metrics/Function/src/Function/Function.cs +++ b/libraries/tests/e2e/functions/core/metrics/Function/src/Function/Function.cs @@ -1,11 +1,12 @@ using Amazon.Lambda.APIGatewayEvents; using Amazon.Lambda.Core; using AWS.Lambda.Powertools.Metrics; +using Helpers; // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class. [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] -namespace Helpers; +namespace Function; public class Function { diff --git a/libraries/tests/e2e/functions/core/payload.json b/libraries/tests/e2e/functions/core/payload.json index 8f80d0a3..9f23a4b7 100644 --- a/libraries/tests/e2e/functions/core/payload.json +++ b/libraries/tests/e2e/functions/core/payload.json @@ -10,14 +10,7 @@ "headers": { "Accept-Encoding": "gzip, deflate, sdch", "Accept-Language": "en-US,en;q=0.8", - "Cache-Control": "max-age=0", - "CloudFront-Forwarded-Proto": "https", - "CloudFront-Viewer-Country": "US", - "Upgrade-Insecure-Requests": "1", - "User-Agent": "Custom User Agent String", - "X-Forwarded-For": "127.0.0.1, 127.0.0.2", - "X-Forwarded-Port": "443", - "X-Forwarded-Proto": "https" + "Cache-Control": "max-age=0" }, "requestContext": { "accountId": "123456789012", diff --git a/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs b/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs index 9f60146e..70eb6ada 100644 --- a/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs +++ b/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs @@ -17,7 +17,10 @@ public class FunctionTest public FunctionTest(ITestOutputHelper testOutputHelper) { _testOutputHelper = testOutputHelper; - _lambdaClient = new AmazonLambdaClient(); + _lambdaClient = new AmazonLambdaClient(new AmazonLambdaConfig + { + Timeout = TimeSpan.FromSeconds(7000) + }); } [Theory] From 0497cb13e75e1f320a701095eb1322c7fe7987e4 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:38:46 +0000 Subject: [PATCH 13/21] add timeout --- .../core/tracing/Function/test/Function.Tests/FunctionTest.cs | 2 +- libraries/tests/e2e/infra-aot/FunctionConstruct.cs | 2 ++ libraries/tests/e2e/infra/FunctionConstruct.cs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs b/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs index 70eb6ada..1cabb3d9 100644 --- a/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs +++ b/libraries/tests/e2e/functions/core/tracing/Function/test/Function.Tests/FunctionTest.cs @@ -19,7 +19,7 @@ public FunctionTest(ITestOutputHelper testOutputHelper) _testOutputHelper = testOutputHelper; _lambdaClient = new AmazonLambdaClient(new AmazonLambdaConfig { - Timeout = TimeSpan.FromSeconds(7000) + Timeout = TimeSpan.FromSeconds(7) }); } diff --git a/libraries/tests/e2e/infra-aot/FunctionConstruct.cs b/libraries/tests/e2e/infra-aot/FunctionConstruct.cs index 77e135f7..91a21704 100644 --- a/libraries/tests/e2e/infra-aot/FunctionConstruct.cs +++ b/libraries/tests/e2e/infra-aot/FunctionConstruct.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Amazon.CDK; using Amazon.CDK.AWS.Lambda; using Constructs; using TestUtils; @@ -18,6 +19,7 @@ public FunctionConstruct(Construct scope, string id, FunctionConstructProps prop FunctionName = props.Name, Handler = props.Handler, Tracing = Tracing.ACTIVE, + Timeout = Duration.Seconds(10), Code = Code.FromCustomCommand(distPath, [ $"dotnet-lambda package -pl {props.SourcePath} -o {distPath} -f {framework} -farch {props.Architecture.Name} -cifb public.ecr.aws/sam/build-dotnet8" diff --git a/libraries/tests/e2e/infra/FunctionConstruct.cs b/libraries/tests/e2e/infra/FunctionConstruct.cs index 1aa1d840..127d1875 100644 --- a/libraries/tests/e2e/infra/FunctionConstruct.cs +++ b/libraries/tests/e2e/infra/FunctionConstruct.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Amazon.CDK; using Amazon.CDK.AWS.Lambda; using Constructs; using TestUtils; @@ -18,6 +19,7 @@ public FunctionConstruct(Construct scope, string id, FunctionConstructProps prop FunctionName = props.Name, Handler = props.Handler, Tracing = Tracing.ACTIVE, + Timeout = Duration.Seconds(10), Code = Code.FromCustomCommand(distPath, [ $"dotnet-lambda package -pl {props.SourcePath} -o {distPath} -f {framework} -farch {props.Architecture.Name}" From c6d300f6f8f599b6a33853c313f26f2d445ca3af Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:53:28 +0000 Subject: [PATCH 14/21] first aot commit --- .github/workflows/e2e-tests.yml | 39 +++++++++++++++++++ .../tests/e2e/infra-aot/FunctionConstruct.cs | 3 +- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 1616038c..373ec203 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -50,6 +50,40 @@ jobs: cd libraries/tests/e2e/infra cdk deploy --require-approval never + deploy-aot-stack: + runs-on: ubuntu-latest + strategy: + matrix: + architecture: [ x86_64, arm64 ] + steps: + - name: Checkout code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 + with: + role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} + aws-region: us-east-1 + + - name: Set up .NET + uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 + with: + dotnet-version: '8.x' + + - name: Install CDK + run: npm install -g aws-cdk + + - name: Install AWS Lambda .NET CLI Tools + run: dotnet tool install -g Amazon.Lambda.Tools + + - name: Set up QEMU + uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a + + - name: Deploy AOT Stack + run: | + cd libraries/tests/e2e/infra-aot + cdk deploy --require-approval never + run-tests: runs-on: ubuntu-latest needs: deploy-stack @@ -99,3 +133,8 @@ jobs: run: | cd libraries/tests/e2e/infra cdk destroy --force + + - name: Destroy Core AOT Stack + run: | + cd libraries/tests/e2e/infra-aot + cdk destroy --force diff --git a/libraries/tests/e2e/infra-aot/FunctionConstruct.cs b/libraries/tests/e2e/infra-aot/FunctionConstruct.cs index 91a21704..feaefd73 100644 --- a/libraries/tests/e2e/infra-aot/FunctionConstruct.cs +++ b/libraries/tests/e2e/infra-aot/FunctionConstruct.cs @@ -10,7 +10,6 @@ public class FunctionConstruct : Construct { public FunctionConstruct(Construct scope, string id, FunctionConstructProps props) : base(scope, id) { - var framework = props.Runtime == Runtime.DOTNET_6 ? "net6.0" : "net8.0"; var distPath = $"{props.DistPath}/deploy_{props.Architecture.Name}_{props.Runtime.Name}.zip"; _ = new Function(this, id, new FunctionProps { @@ -22,7 +21,7 @@ public FunctionConstruct(Construct scope, string id, FunctionConstructProps prop Timeout = Duration.Seconds(10), Code = Code.FromCustomCommand(distPath, [ - $"dotnet-lambda package -pl {props.SourcePath} -o {distPath} -f {framework} -farch {props.Architecture.Name} -cifb public.ecr.aws/sam/build-dotnet8" + $"dotnet-lambda package -pl {props.SourcePath} -o {distPath} -f net8.0 -farch {props.Architecture.Name} -cifb public.ecr.aws/sam/build-dotnet8" ], new CustomCommandOptions { From 4fd3678c9703e907e4bee12bde3e24fba7901acb Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:17:05 +0000 Subject: [PATCH 15/21] refactor AOT stack to read parameters. e2e architecture matrix. first aot test --- .github/workflows/e2e-tests.yml | 6 ++--- .../src/AOT-Function/AOT-Function.csproj | 6 ++--- .../test/Function.Tests/FunctionTest.cs | 2 +- .../tests/e2e/infra-aot/AOTStackProps.cs | 8 +++++++ libraries/tests/e2e/infra-aot/CoreAotStack.cs | 22 +++++++++---------- .../tests/e2e/infra-aot/FunctionConstruct.cs | 2 +- libraries/tests/e2e/infra-aot/Program.cs | 19 ++++++++++++++-- 7 files changed, 43 insertions(+), 22 deletions(-) create mode 100644 libraries/tests/e2e/infra-aot/AOTStackProps.cs diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 373ec203..332dcc9d 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -76,13 +76,13 @@ jobs: - name: Install AWS Lambda .NET CLI Tools run: dotnet tool install -g Amazon.Lambda.Tools - - name: Set up QEMU - uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a +# - name: Set up QEMU +# uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a - name: Deploy AOT Stack run: | cd libraries/tests/e2e/infra-aot - cdk deploy --require-approval never + cdk deploy -c architecture=${{ matrix.architecture }} --require-approval never run-tests: runs-on: ubuntu-latest diff --git a/libraries/tests/e2e/functions/core/logging/AOT-Function/src/AOT-Function/AOT-Function.csproj b/libraries/tests/e2e/functions/core/logging/AOT-Function/src/AOT-Function/AOT-Function.csproj index 7af75f9b..b2636d6b 100644 --- a/libraries/tests/e2e/functions/core/logging/AOT-Function/src/AOT-Function/AOT-Function.csproj +++ b/libraries/tests/e2e/functions/core/logging/AOT-Function/src/AOT-Function/AOT-Function.csproj @@ -22,12 +22,12 @@ - - - TestHelper.cs + + + \ No newline at end of file diff --git a/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs b/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs index b20ef66a..b4312dfe 100644 --- a/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs +++ b/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs @@ -25,7 +25,7 @@ public FunctionTest(ITestOutputHelper testOutputHelper) [InlineData("E2ETestLambda_ARM_NET6_logging")] [InlineData("E2ETestLambda_X64_NET8_logging")] [InlineData("E2ETestLambda_ARM_NET8_logging")] - // [InlineData("E2ETestLambda_ARM_AOT_NET8_logging")] + [InlineData("E2ETestLambda_ARM_AOT_NET8_logging")] public async Task TestFunction(string functionName) { var request = new InvokeRequest diff --git a/libraries/tests/e2e/infra-aot/AOTStackProps.cs b/libraries/tests/e2e/infra-aot/AOTStackProps.cs new file mode 100644 index 00000000..4e735a8f --- /dev/null +++ b/libraries/tests/e2e/infra-aot/AOTStackProps.cs @@ -0,0 +1,8 @@ +using Amazon.CDK; + +namespace InfraAot; + +public class AotStackProps : StackProps +{ + public string Architecture { get; set; } +} \ No newline at end of file diff --git a/libraries/tests/e2e/infra-aot/CoreAotStack.cs b/libraries/tests/e2e/infra-aot/CoreAotStack.cs index 80efaf04..40197ab5 100644 --- a/libraries/tests/e2e/infra-aot/CoreAotStack.cs +++ b/libraries/tests/e2e/infra-aot/CoreAotStack.cs @@ -1,4 +1,3 @@ -using System.Runtime.InteropServices; using Amazon.CDK; using Amazon.CDK.AWS.Lambda; using Constructs; @@ -9,8 +8,12 @@ namespace InfraAot; public class CoreAotStack : Stack { - internal CoreAotStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props) + private readonly Architecture _architecture; + + internal CoreAotStack(Construct scope, string id, AotStackProps props = null) : base(scope, id, props) { + if (props != null) _architecture = props.Architecture == "arm64" ? Architecture.ARM_64 : Architecture.X86_64; + CreateFunctionConstructs("logging"); CreateFunctionConstructs("metrics"); CreateFunctionConstructs("tracing"); @@ -20,19 +23,14 @@ private void CreateFunctionConstructs(string utility) { var baseAotPath = $"../functions/core/{utility}/AOT-Function/src/AOT-Function"; var distAotPath = $"../functions/core/{utility}/AOT-Function/dist"; + var arch = _architecture == Architecture.X86_64 ? "X64" : "ARM"; - switch (RuntimeInformation.OSArchitecture) - { - case System.Runtime.InteropServices.Architecture.Arm64: - CreateFunctionConstruct(this, $"{utility}_ARM_aot_net8", Runtime.DOTNET_8, Architecture.ARM_64, $"E2ETestLambda_ARM_AOT_NET8_{utility}", baseAotPath, distAotPath); - break; - case System.Runtime.InteropServices.Architecture.X64: - CreateFunctionConstruct(this, $"{utility}_X64_aot_net8", Runtime.DOTNET_8, Architecture.X86_64, $"E2ETestLambda_X64_AOT_NET8_{utility}", baseAotPath, distAotPath); - break; - } + CreateFunctionConstruct(this, $"{utility}_ARM_aot_net8", Runtime.DOTNET_8, _architecture, + $"E2ETestLambda_{arch}_AOT_NET8_{utility}", baseAotPath, distAotPath); } - private void CreateFunctionConstruct(Construct scope, string id, Runtime runtime, Architecture architecture, string name, string sourcePath, string distPath) + private void CreateFunctionConstruct(Construct scope, string id, Runtime runtime, Architecture architecture, + string name, string sourcePath, string distPath) { _ = new FunctionConstruct(scope, id, new FunctionConstructProps { diff --git a/libraries/tests/e2e/infra-aot/FunctionConstruct.cs b/libraries/tests/e2e/infra-aot/FunctionConstruct.cs index feaefd73..aa4e92cb 100644 --- a/libraries/tests/e2e/infra-aot/FunctionConstruct.cs +++ b/libraries/tests/e2e/infra-aot/FunctionConstruct.cs @@ -21,7 +21,7 @@ public FunctionConstruct(Construct scope, string id, FunctionConstructProps prop Timeout = Duration.Seconds(10), Code = Code.FromCustomCommand(distPath, [ - $"dotnet-lambda package -pl {props.SourcePath} -o {distPath} -f net8.0 -farch {props.Architecture.Name} -cifb public.ecr.aws/sam/build-dotnet8" + $"dotnet-lambda package -pl {props.SourcePath} -cmd ../../../ -o {distPath} -f net8.0 -farch {props.Architecture.Name} -cifb public.ecr.aws/sam/build-dotnet8" ], new CustomCommandOptions { diff --git a/libraries/tests/e2e/infra-aot/Program.cs b/libraries/tests/e2e/infra-aot/Program.cs index acf0e4bd..085a7dbe 100644 --- a/libraries/tests/e2e/infra-aot/Program.cs +++ b/libraries/tests/e2e/infra-aot/Program.cs @@ -7,8 +7,23 @@ internal static class Program public static void Main(string[] args) { var app = new App(); - _ = new CoreAotStack(app, "CoreAotStack", new StackProps { }); + + var architecture = app.Node.TryGetContext("architecture")?.ToString(); + if (architecture == null) + { + throw new System.ArgumentException("architecture context is required. Please provide it with --context architecture=arm64|x86_64"); + } + + if (architecture != "arm64" && architecture != "x86_64") + { + throw new System.ArgumentException("architecture context must be either arm64 or x86_64"); + } + + _ = new CoreAotStack(app, "CoreAotStack", new AotStackProps + { + Architecture = architecture + }); app.Synth(); } } -} +} \ No newline at end of file From f87af586b2ce225eba557af36784697efb6134b7 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:25:42 +0000 Subject: [PATCH 16/21] fail fast false, qemu --- .github/workflows/e2e-tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 332dcc9d..597df8a2 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -53,6 +53,7 @@ jobs: deploy-aot-stack: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: architecture: [ x86_64, arm64 ] steps: @@ -76,8 +77,8 @@ jobs: - name: Install AWS Lambda .NET CLI Tools run: dotnet tool install -g Amazon.Lambda.Tools -# - name: Set up QEMU -# uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a + - name: Set up QEMU + uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a - name: Deploy AOT Stack run: | From 393527b68a7861c2c6d33b3095868a5db8c2b7ab Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:40:20 +0000 Subject: [PATCH 17/21] fix destroy, qemu fix --- .github/workflows/e2e-tests.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 597df8a2..0729175c 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -80,6 +80,14 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v3 + with: + platforms: ${{ matrix.architecture }} + - name: Deploy AOT Stack run: | cd libraries/tests/e2e/infra-aot @@ -138,4 +146,5 @@ jobs: - name: Destroy Core AOT Stack run: | cd libraries/tests/e2e/infra-aot - cdk destroy --force + cdk destroy -c architecture=arm64 --force + cdk destroy -c architecture=x86_64 --force From 716a00f259e2b4b1bde0ad571ad6afd1bd092a91 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:47:27 +0000 Subject: [PATCH 18/21] new aot test --- .github/workflows/e2e-tests.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 0729175c..7370d75e 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -79,15 +79,18 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a - + with: + platforms: ${{ matrix.architecture }} + - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - uses: docker/build-push-action@v3 + id: builder + uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 with: + install: true + driver: docker platforms: ${{ matrix.architecture }} + - name: Deploy AOT Stack run: | cd libraries/tests/e2e/infra-aot From f48ecbc7aba3f87b9fec4df28d7113b8da068361 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:51:55 +0000 Subject: [PATCH 19/21] again aot fix --- .github/workflows/e2e-tests.yml | 42 ++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 7370d75e..3dd2b40c 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -90,7 +90,6 @@ jobs: driver: docker platforms: ${{ matrix.architecture }} - - name: Deploy AOT Stack run: | cd libraries/tests/e2e/infra-aot @@ -146,8 +145,45 @@ jobs: cd libraries/tests/e2e/infra cdk destroy --force + destroy-aot-stack: + runs-on: ubuntu-latest + needs: run-tests + if: always() + strategy: + fail-fast: false + matrix: + architecture: [ x86_64, arm64 ] + steps: + - name: Checkout code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 + with: + role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} + aws-region: us-east-1 + mask-aws-account-id: true + + - name: Install CDK + run: npm install -g aws-cdk + + - name: Install AWS Lambda .NET CLI Tools + run: dotnet tool install -g Amazon.Lambda.Tools + + - name: Set up QEMU + uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a + with: + platforms: ${{ matrix.architecture }} + + - name: Set up Docker Buildx + id: builder + uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 + with: + install: true + driver: docker + platforms: ${{ matrix.architecture }} + - name: Destroy Core AOT Stack run: | cd libraries/tests/e2e/infra-aot - cdk destroy -c architecture=arm64 --force - cdk destroy -c architecture=x86_64 --force + cdk destroy -c architecture=${{ matrix.architecture }} --force From 98f39b1d5e414a9da0f7a3c6f816ae901584ffa8 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:03:53 +0000 Subject: [PATCH 20/21] another test --- .github/workflows/e2e-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 3dd2b40c..be0e61fb 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -88,7 +88,7 @@ jobs: with: install: true driver: docker - platforms: ${{ matrix.architecture }} + platforms: linux/amd64,linux/arm64 - name: Deploy AOT Stack run: | @@ -181,7 +181,7 @@ jobs: with: install: true driver: docker - platforms: ${{ matrix.architecture }} + platforms: linux/amd64,linux/arm64 - name: Destroy Core AOT Stack run: | From 37bfb36469f6ffa66d1b5fc372bac8c15caa6071 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:12:01 +0000 Subject: [PATCH 21/21] remove aot for now --- .github/workflows/e2e-tests.yml | 172 +++++++++--------- .../test/Function.Tests/FunctionTest.cs | 2 +- 2 files changed, 87 insertions(+), 87 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index be0e61fb..739a5045 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -50,50 +50,50 @@ jobs: cd libraries/tests/e2e/infra cdk deploy --require-approval never - deploy-aot-stack: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - architecture: [ x86_64, arm64 ] - steps: - - name: Checkout code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 - with: - role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} - aws-region: us-east-1 - - - name: Set up .NET - uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 - with: - dotnet-version: '8.x' - - - name: Install CDK - run: npm install -g aws-cdk - - - name: Install AWS Lambda .NET CLI Tools - run: dotnet tool install -g Amazon.Lambda.Tools - - - name: Set up QEMU - uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a - with: - platforms: ${{ matrix.architecture }} - - - name: Set up Docker Buildx - id: builder - uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 - with: - install: true - driver: docker - platforms: linux/amd64,linux/arm64 - - - name: Deploy AOT Stack - run: | - cd libraries/tests/e2e/infra-aot - cdk deploy -c architecture=${{ matrix.architecture }} --require-approval never +# deploy-aot-stack: +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# architecture: [ x86_64, arm64 ] +# steps: +# - name: Checkout code +# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 +# +# - name: Configure AWS credentials +# uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 +# with: +# role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} +# aws-region: us-east-1 +# +# - name: Set up .NET +# uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 +# with: +# dotnet-version: '8.x' +# +# - name: Install CDK +# run: npm install -g aws-cdk +# +# - name: Install AWS Lambda .NET CLI Tools +# run: dotnet tool install -g Amazon.Lambda.Tools +# +# - name: Set up QEMU +# uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a +# with: +# platforms: ${{ matrix.architecture }} +# +# - name: Set up Docker Buildx +# id: builder +# uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 +# with: +# install: true +# driver: docker +# platforms: linux/amd64,linux/arm64 +# +# - name: Deploy AOT Stack +# run: | +# cd libraries/tests/e2e/infra-aot +# cdk deploy -c architecture=${{ matrix.architecture }} --require-approval never run-tests: runs-on: ubuntu-latest @@ -145,45 +145,45 @@ jobs: cd libraries/tests/e2e/infra cdk destroy --force - destroy-aot-stack: - runs-on: ubuntu-latest - needs: run-tests - if: always() - strategy: - fail-fast: false - matrix: - architecture: [ x86_64, arm64 ] - steps: - - name: Checkout code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 - with: - role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} - aws-region: us-east-1 - mask-aws-account-id: true - - - name: Install CDK - run: npm install -g aws-cdk - - - name: Install AWS Lambda .NET CLI Tools - run: dotnet tool install -g Amazon.Lambda.Tools - - - name: Set up QEMU - uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a - with: - platforms: ${{ matrix.architecture }} - - - name: Set up Docker Buildx - id: builder - uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 - with: - install: true - driver: docker - platforms: linux/amd64,linux/arm64 - - - name: Destroy Core AOT Stack - run: | - cd libraries/tests/e2e/infra-aot - cdk destroy -c architecture=${{ matrix.architecture }} --force +# destroy-aot-stack: +# runs-on: ubuntu-latest +# needs: run-tests +# if: always() +# strategy: +# fail-fast: false +# matrix: +# architecture: [ x86_64, arm64 ] +# steps: +# - name: Checkout code +# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 +# +# - name: Configure AWS credentials +# uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 +# with: +# role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }} +# aws-region: us-east-1 +# mask-aws-account-id: true +# +# - name: Install CDK +# run: npm install -g aws-cdk +# +# - name: Install AWS Lambda .NET CLI Tools +# run: dotnet tool install -g Amazon.Lambda.Tools +# +# - name: Set up QEMU +# uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a +# with: +# platforms: ${{ matrix.architecture }} +# +# - name: Set up Docker Buildx +# id: builder +# uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 +# with: +# install: true +# driver: docker +# platforms: linux/amd64,linux/arm64 +# +# - name: Destroy Core AOT Stack +# run: | +# cd libraries/tests/e2e/infra-aot +# cdk destroy -c architecture=${{ matrix.architecture }} --force diff --git a/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs b/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs index b4312dfe..b20ef66a 100644 --- a/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs +++ b/libraries/tests/e2e/functions/core/logging/Function/test/Function.Tests/FunctionTest.cs @@ -25,7 +25,7 @@ public FunctionTest(ITestOutputHelper testOutputHelper) [InlineData("E2ETestLambda_ARM_NET6_logging")] [InlineData("E2ETestLambda_X64_NET8_logging")] [InlineData("E2ETestLambda_ARM_NET8_logging")] - [InlineData("E2ETestLambda_ARM_AOT_NET8_logging")] + // [InlineData("E2ETestLambda_ARM_AOT_NET8_logging")] public async Task TestFunction(string functionName) { var request = new InvokeRequest