Skip to content

chore: Add Aot e2e tests for x86 #699

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 10 commits into from
Jan 16, 2025
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
126 changes: 38 additions & 88 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,54 +50,37 @@ 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
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good idea.

From a functional perspective, the CLI will go out of sync with the assembly version you have in the tests, and eventually fail.

From a security perspective, you're not pinning the dependency to a specific version/hash in a lock file, which opens up to supply chain security issues.


- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools

- name: Deploy AOT Stack x86_64
run: |
cd libraries/tests/e2e/infra-aot
cdk deploy -c architecture=x86_64 --require-approval never

run-tests:
runs-on: ubuntu-latest
needs: deploy-stack
needs: [deploy-stack,deploy-aot-stack]
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand All @@ -117,7 +100,12 @@ jobs:
- name: Run Core Tests
run: |
cd libraries/tests/e2e/functions/core
dotnet test
dotnet test --filter Category!=AOT

- name: Run Core AOT Tests
run: |
cd libraries/tests/e2e/functions/core
dotnet test --filter Category=AOT

destroy-stack:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -145,45 +133,7 @@ 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
- name: Destroy AOT Core Stack
run: |
cd libraries/tests/e2e/infra-aot
cdk destroy -c architecture=x86_64 --force
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,37 @@
namespace Function.Tests;

[Trait("Category", "E2E")]
public class FunctionTest
public class FunctionTests
{
private readonly ITestOutputHelper _testOutputHelper;
private readonly AmazonLambdaClient _lambdaClient;

public FunctionTest(ITestOutputHelper testOutputHelper)
public FunctionTests(ITestOutputHelper testOutputHelper)
{
_testOutputHelper = testOutputHelper;
_lambdaClient = new AmazonLambdaClient();
}

[Trait("Category", "AOT")]
[Theory]
[InlineData("E2ETestLambda_X64_AOT_NET8_logging")]
// [InlineData("E2ETestLambda_ARM_AOT_NET8_metrics")]
public async Task AotFunctionTest(string functionName)
{
await TestFunction(functionName);
}

[Theory]
[InlineData("E2ETestLambda_X64_NET6_logging")]
[InlineData("E2ETestLambda_ARM_NET6_logging")]
[InlineData("E2ETestLambda_X64_NET8_logging")]
[InlineData("E2ETestLambda_ARM_NET8_logging")]
// [InlineData("E2ETestLambda_ARM_AOT_NET8_logging")]
public async Task TestFunction(string functionName)
public async Task FunctionTest(string functionName)
{
await TestFunction(functionName);
}

internal async Task TestFunction(string functionName)
{
var request = new InvokeRequest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,37 @@
namespace Function.Tests;

[Trait("Category", "E2E")]
public class FunctionTest
public class FunctionTests
{
private readonly ITestOutputHelper _testOutputHelper;
private readonly AmazonLambdaClient _lambdaClient;

public FunctionTest(ITestOutputHelper testOutputHelper)
public FunctionTests(ITestOutputHelper testOutputHelper)
{
_testOutputHelper = testOutputHelper;
_lambdaClient = new AmazonLambdaClient();
}

[Trait("Category", "AOT")]
[Theory]
[InlineData("E2ETestLambda_X64_AOT_NET8_metrics")]
// [InlineData("E2ETestLambda_ARM_AOT_NET8_metrics")]
public async Task AotFunctionTest(string functionName)
{
await TestFunction(functionName);
}

[Theory]
[InlineData("E2ETestLambda_X64_NET6_metrics")]
[InlineData("E2ETestLambda_ARM_NET6_metrics")]
[InlineData("E2ETestLambda_X64_NET8_metrics")]
[InlineData("E2ETestLambda_ARM_NET8_metrics")]
// [InlineData("E2ETestLambda_ARM_AOT_NET8_metrics")]
public async Task TestFunction(string functionName)
public async Task FunctionTest(string functionName)
{
await TestFunction(functionName);
}

internal async Task TestFunction(string functionName)
{
var request = new InvokeRequest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,40 @@
namespace Function.Tests;

[Trait("Category", "E2E")]
public class FunctionTest
public class FunctionTests
{
private readonly ITestOutputHelper _testOutputHelper;
private readonly AmazonLambdaClient _lambdaClient;

public FunctionTest(ITestOutputHelper testOutputHelper)
public FunctionTests(ITestOutputHelper testOutputHelper)
{
_testOutputHelper = testOutputHelper;
_lambdaClient = new AmazonLambdaClient(new AmazonLambdaConfig
{
Timeout = TimeSpan.FromSeconds(7)
});
}

[Trait("Category", "AOT")]
[Theory]
[InlineData("E2ETestLambda_X64_AOT_NET8_tracing")]
// [InlineData("E2ETestLambda_ARM_AOT_NET8_tracing")]
public async Task AotFunctionTest(string functionName)
{
await TestFunction(functionName);
}

[Theory]
[InlineData("E2ETestLambda_X64_NET6_tracing")]
[InlineData("E2ETestLambda_ARM_NET6_tracing")]
[InlineData("E2ETestLambda_X64_NET8_tracing")]
[InlineData("E2ETestLambda_ARM_NET8_tracing")]
// [InlineData("E2ETestLambda_ARM_AOT_NET8_tracing")]
public async Task TestToUpperFunction(string functionName)
public async Task FunctionTest(string functionName)
{
await TestFunction(functionName);
}

internal async Task TestFunction(string functionName)
{
var request = new InvokeRequest
{
Expand Down
Loading