Skip to content

Commit

Permalink
Change E2E Testing Resource Repo from OTEL to Application Framework
Browse files Browse the repository at this point in the history
  • Loading branch information
harrryr committed Feb 28, 2024
1 parent 3a4f0c9 commit a0a90d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 138 deletions.
97 changes: 0 additions & 97 deletions .github/actions/patch-dependencies/action.yml

This file was deleted.

56 changes: 15 additions & 41 deletions .github/workflows/appsignals-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ permissions:

env:
AWS_DEFAULT_REGION: us-east-1
TEST_ACCOUNT: ${{ secrets.APP_SIGNALS_E2E_TEST_ACCOUNT }}
TEST_ACCOUNT: ${{ secrets.APP_SIGNALS_E2E_TEST_ACCOUNT_ID }}
SAMPLE_APP_NAMESPACE: sample-app-namespace
SAMPLE_APP_FRONTEND_SERVICE_IMAGE: ${{ secrets.APP_SIGNALS_E2E_SAMPLE_APP_FRONTEND_SERVICE_IMAGE }}
SAMPLE_APP_REMOTE_SERVICE_IMAGE: ${{ secrets.APP_SIGNALS_E2E_SAMPLE_APP_REMOTE_SERVICE_IMAGE }}
SAMPLE_APP_FRONTEND_SERVICE_IMAGE: ${{ secrets.APP_SIGNALS_E2E_SAMPLE_APP_FRONTEND_SVC_IMG }}
SAMPLE_APP_REMOTE_SERVICE_IMAGE: ${{ secrets.APP_SIGNALS_E2E_SAMPLE_APP_REMOTE_SVC_IMG }}
METRIC_NAMESPACE: AppSignals
LOG_GROUP: /aws/appsignals/eks
ECR_OPERATOR_STAGING_IMAGE: ${{ secrets.ECR_OPERATOR_STAGING_IMAGE }}
Expand All @@ -34,22 +34,11 @@ jobs:
steps:
# This step avoids code duplication for terraform templates and the validator
# To simplify, we get the entire repo
- name: Get testing resources from ADOT
- name: Get testing resources from aws-application-signals-test-framework
uses: actions/checkout@v4
with:
repository: aws-observability/aws-otel-java-instrumentation
repository: aws-observability/aws-application-signals-test-framework
ref: main

- name: Download patch action script
uses: actions/checkout@v4
with:
path: patch-dependencies
sparse-checkout: |
.github/actions/patch-dependencies/action.yml
- name: Replace patch dependency action.yml
run: |
cp -f ./patch-dependencies/.github/actions/patch-dependencies/action.yml ./.github/actions/patch-dependencies/action.yml

- name: Download enablement script
uses: actions/checkout@v4
Expand All @@ -62,18 +51,13 @@ jobs:
scripts/eks/appsignals/clean-app-signals.sh
sparse-checkout-cone-mode: false

- uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin

- name: Generate testing id
run: echo TESTING_ID="${{ env.AWS_DEFAULT_REGION }}-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.APP_SIGNALS_E2E_TEST_ROLE_ARN }}
role-to-assume: arn:aws:iam::${{ env.TEST_ACCOUNT }}:role/${{ secrets.APP_SIGNALS_E2E_TEST_ROLE_ARN }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}

# local directory to store the kubernetes config
Expand Down Expand Up @@ -111,7 +95,7 @@ jobs:
terraform_wrapper: false

- name: Deploy sample app via terraform
working-directory: testing/terraform/eks
working-directory: terraform/eks
run: |
terraform init
terraform validate
Expand Down Expand Up @@ -189,24 +173,11 @@ jobs:
echo "Operator image did not change"
exit 1
fi
# cache local patch outputs
- name: Cache local Maven repository
id: cache-local-maven-repo
uses: actions/cache@v3
with:
path: |
~/.m2/repository/io/opentelemetry/
key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/opentelemetry-java*.patch') }}

- name: Publish patched dependencies to maven local
uses: ./.github/actions/patch-dependencies
if: steps.cache-local-maven-repo.outputs.cache-hit != 'true'
- name: Get the sample app endpoint
run: |
echo "APP_ENDPOINT=$(terraform output sample_app_endpoint)" >> $GITHUB_ENV
working-directory: testing/terraform/eks
working-directory: terraform/eks

- name: Wait for app endpoint to come online
id: endpoint-check
Expand All @@ -233,11 +204,14 @@ jobs:
curl -S -s -o /dev/null http://${{ env.APP_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_POD_IP }}/
curl -S -s -o /dev/null http://${{ env.APP_ENDPOINT }}/client-call/
- name: Build Gradle
run: ./gradlew

# Validation for app signals telemetry data
- name: Call endpoint and validate generated EMF logs
id: log-validation
if: steps.endpoint-check.outcome == 'success' && !cancelled()
run: ./gradlew testing:validator:run --args='-c eks/log-validation.yml
run: ./gradlew validator:run --args='-c eks/log-validation.yml
--testing-id ${{ env.TESTING_ID }}
--endpoint http://${{ env.APP_ENDPOINT }}
--region ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -254,7 +228,7 @@ jobs:
- name: Call endpoints and validate generated metrics
id: metric-validation
if: (success() || steps.log-validation.outcome == 'failure') && !cancelled()
run: ./gradlew testing:validator:run --args='-c eks/metric-validation.yml
run: ./gradlew validator:run --args='-c eks/metric-validation.yml
--testing-id ${{ env.TESTING_ID }}
--endpoint http://${{ env.APP_ENDPOINT }}
--region ${{ env.AWS_DEFAULT_REGION }}
Expand All @@ -272,7 +246,7 @@ jobs:
- name: Call endpoints and validate generated traces
id: trace-validation
if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled()
run: ./gradlew testing:validator:run --args='-c eks/trace-validation.yml
run: ./gradlew validator:run --args='-c eks/trace-validation.yml
--testing-id ${{ env.TESTING_ID }}
--endpoint http://${{ env.APP_ENDPOINT }}
--region ${{ env.AWS_DEFAULT_REGION }}
Expand Down Expand Up @@ -315,7 +289,7 @@ jobs:
- name: Terraform destroy
if: always()
continue-on-error: true
working-directory: testing/terraform/eks
working-directory: terraform/eks
run: |
terraform destroy -auto-approve \
-var="test_id=${{ env.TESTING_ID }}" \
Expand Down

0 comments on commit a0a90d6

Please sign in to comment.