Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
harrryr committed Oct 3, 2024
1 parent 6879eb7 commit 70adc2b
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/java-eks-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ jobs:
--rollup'

- name: test
continue-on-error: true
if: always()
run: sleep 500

- name: Refresh AWS Credentials
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## including logs, metrics, and traces.
name: Java EKS Enablement Canary Testing
on:
push:
# push:
workflow_dispatch:


Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/test-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# This workflow will build and push the traffic generator to each region whenever there is an update made to the traffic-generator folder.
# This image will be used by EKS and K8s test to call sample app endpoints while the zip files will be used by EC2 Platforms
name: Create and Push Traffic Generator

on:
workflow_dispatch:
push:


permissions:
id-token: write
contents: read

env:
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
matrix:
aws-region: ['us-east-1']
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
aws-region: us-east-1

- name: Retrieve account
uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
secret-ids: |
ACCOUNT_ID, region-account/${{ matrix.aws-region }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
aws-region: ${{ matrix.aws-region }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build, tag, and push image to Amazon ECR
working-directory: sample-apps/traffic-generator
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: e2e-test-resource
IMAGE_TAG: traffic-generator
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
# upload-files-to-s3:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1',
# 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
# 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1',
# 'us-east-1','us-east-2', 'us-west-1', 'us-west-2']
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
# aws-region: us-east-1
#
# - name: Retrieve account
# uses: aws-actions/aws-secretsmanager-get-secrets@v1
# with:
# secret-ids: |
# ACCOUNT_ID, region-account/${{ matrix.aws-region }}
#
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
# aws-region: ${{ matrix.aws-region }}
#
# - name: Upload traffic generator files
# working-directory: sample-apps/traffic-generator
# run: |
# zip traffic-generator.zip ./index.js ./package.json
# aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-${{ matrix.aws-region }}/traffic-generator.zip
80 changes: 37 additions & 43 deletions .github/workflows/traffic-generator-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ name: Create and Push Traffic Generator
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'sample-apps/traffic-generator/**'


permissions:
id-token: write
Expand All @@ -23,10 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1',
'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1',
'us-east-1','us-east-2', 'us-west-1', 'us-west-2']
aws-region: ['us-east-1']
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -63,38 +57,38 @@ jobs:
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
upload-files-to-s3:
runs-on: ubuntu-latest
strategy:
matrix:
aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1',
'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1',
'us-east-1','us-east-2', 'us-west-1', 'us-west-2']
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
aws-region: us-east-1

- name: Retrieve account
uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
secret-ids: |
ACCOUNT_ID, region-account/${{ matrix.aws-region }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
aws-region: ${{ matrix.aws-region }}

- name: Upload traffic generator files
working-directory: sample-apps/traffic-generator
run: |
zip traffic-generator.zip ./index.js ./package.json
aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-${{ matrix.aws-region }}/traffic-generator.zip
# upload-files-to-s3:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1',
# 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
# 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1',
# 'us-east-1','us-east-2', 'us-west-1', 'us-west-2']
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
# aws-region: us-east-1
#
# - name: Retrieve account
# uses: aws-actions/aws-secretsmanager-get-secrets@v1
# with:
# secret-ids: |
# ACCOUNT_ID, region-account/${{ matrix.aws-region }}
#
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
# aws-region: ${{ matrix.aws-region }}
#
# - name: Upload traffic generator files
# working-directory: sample-apps/traffic-generator
# run: |
# zip traffic-generator.zip ./index.js ./package.json
# aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-${{ matrix.aws-region }}/traffic-generator.zip
1 change: 0 additions & 1 deletion sample-apps/traffic-generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const trafficGenerator = async (interval) => {
`http://${mainEndpoint}/aws-sdk-call?ip=${remoteEndpoint}&testingId=${id}`,
`http://${mainEndpoint}/remote-service?ip=${remoteEndpoint}&testingId=${id}`,
`http://${mainEndpoint}/client-call`,
`http://${mainEndpoint}/mysql`,
];

await sendRequests(urls);
Expand Down

0 comments on commit 70adc2b

Please sign in to comment.