-
Notifications
You must be signed in to change notification settings - Fork 26
chore: Add end-to-end tests #684
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
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d14398a
initial commit of e2e infra and functions
hjgraca f58b592
refactor and add aot functions and tests
hjgraca a00c31b
Add ApiGatewayEvents, add tests for Logging, add TestUtil project for…
hjgraca cdd3873
Refactor stack creation. split tests for logging, metrics and tracing…
hjgraca d5084be
add metrics and tracing. split stacks
hjgraca 28c122d
split CDK stack AOT and non-AOT. refactor. Initial GH actions pipelines
hjgraca 5e8677c
update workflows. filter e2e tests from build. Add trait Category=E2E…
hjgraca fe385cf
fix sonar issues
hjgraca 4b2a142
fix sonar security, move regex to source generated
hjgraca f64386b
refactor to lower code duplication
hjgraca 6ae2e0e
fix build
hjgraca 5c4e84c
sonar warnings
hjgraca 324b912
fix sonar, static classes
hjgraca 58bb4e6
Merge branch 'develop' of https://github.com/hjgraca/powertools-lambd…
hjgraca 0c4721b
update workflows
hjgraca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# 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 | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
deploy-core-stack: | ||
runs-on: aws-powertools_ubuntu-latest_8-core | ||
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: ${{ secrets.E2E_DEPLOY_REGION }} | ||
|
||
- 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 | ||
|
||
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: ${{ secrets.E2E_DEPLOY_REGION }} | ||
|
||
- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 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 | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
destroy-stacks: | ||
runs-on: aws-powertools_ubuntu-latest_8-core | ||
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: ${{ secrets.E2E_DEPLOY_REGION }} | ||
|
||
- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# PROCESS | ||
# | ||
# 1. Deploy the core and AOT stacks using the infra deployment workflow. | ||
# 2. Run the E2E tests after the infrastructure is deployed. | ||
# 3. Destroy the CDK stacks after the tests are completed. | ||
|
||
# USAGE | ||
# | ||
# This workflow is triggered on push to the develop branch or manually via workflow_dispatch. | ||
|
||
name: E2E Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- develop | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
deploy-core-stack: | ||
uses: ./.github/workflows/e2e-infra-deploy.yml | ||
|
||
deploy-aot-stack: | ||
uses: ./.github/workflows/e2e-infra-deploy.yml | ||
|
||
run-tests: | ||
runs-on: aws-powertools_ubuntu-latest_8-core | ||
# needs: [deploy-core-stack, deploy-aot-stack] | ||
needs: [deploy-core-stack] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | ||
|
||
- name: Set up .NET | ||
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 | ||
with: | ||
dotnet-version: '8.x' | ||
|
||
- name: Run Core Tests | ||
run: | | ||
cd libraries/tests/e2e/functions/core | ||
dotnet test | ||
|
||
- name: Destroy Core Stack | ||
if: always() | ||
uses: ./.github/workflows/e2e-infra-destroy.yml | ||
|
||
# destroy-core-stack: | ||
# needs: run-tests | ||
# uses: ./.github/workflows/e2e-infra-destroy.yml |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.