Skip to content

Commit

Permalink
Update E2E Test to Reflect Latest Artifacts (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
harrryr authored May 20, 2024
1 parent 14bf407 commit d54f5dc
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ jobs:
group: 'e2e-cw-agent-java-operator-test'
cancel-in-progress: false
secrets: inherit
uses: ./.github/workflows/appsignals-java-e2e-test.yml
uses: ./.github/workflows/application-signals-java-e2e-test.yml
with:
test-java-cluster-name: ${{ inputs.test-java-cluster-name }}
tag: 'staging'
tag: ${{ inputs.tag }}

python-e2e-tests:
# Two E2E tests should not run at the same time in the same EKS cluster
concurrency:
group: 'e2e-cw-agent-python-operator-test'
cancel-in-progress: false
secrets: inherit
uses: ./.github/workflows/appsignals-python-e2e-test.yml
uses: ./.github/workflows/application-signals-python-e2e-test.yml
with:
test-python-cluster-name: ${{ inputs.test-python-cluster-name }}
tag: 'staging'
tag: ${{ inputs.tag }}
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ env:
SAMPLE_APP_NAMESPACE: sample-app-namespace
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
METRIC_NAMESPACE: ApplicationSignals
LOG_GROUP: /aws/application-signals/data
ECR_OPERATOR_STAGING_REPO: ${{ vars.ECR_OPERATOR_STAGING_REPO }}
APPLICATION_SIGNALS_ADOT_IMAGE: 611364707713.dkr.ecr.us-west-2.amazonaws.com/adot-autoinstrumentation-java-operator-staging:1.33.0-SNAPSHOT-91cbba8
APPLICATION_SIGNALS_CW_AGENT_IMAGE: 506463145083.dkr.ecr.us-west-2.amazonaws.com/cwagent-integration-test:00ef994d0feaa8ebe03da61cd9fcfcc1f20ca650

jobs:
appsignals-e2e-test:
appsignals-java-e2e-test:
runs-on: ubuntu-latest
steps:
# This step avoids code duplication for terraform templates and the validator
Expand All @@ -44,7 +46,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: aws-observability/aws-application-signals-test-framework
ref: main
ref: ga-release

- name: Download enablement script
uses: actions/checkout@v4
Expand Down Expand Up @@ -134,6 +136,22 @@ jobs:
run: |
kubectl patch deploy -n amazon-cloudwatch amazon-cloudwatch-observability-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "${{ env.ECR_OPERATOR_STAGING_REPO }}:${{ inputs.tag }}"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]]'
kubectl delete pods --all -n amazon-cloudwatch
sleep 10
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
- name: Patch the CloudWatch Agent image and restart CloudWatch pods
run: |
kubectl patch amazoncloudwatchagents -n amazon-cloudwatch cloudwatch-agent --type='json' -p='[{"op": "replace", "path": "/spec/image", "value": "${{ env.APPLICATION_SIGNALS_CW_AGENT_IMAGE }}"}]'
kubectl delete pods --all -n amazon-cloudwatch
sleep 10
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
- name: Patch the ADOT image and restart CloudWatch pods
run: |
kubectl patch deploy -namazon-cloudwatch amazon-cloudwatch-observability-controller-manager --type='json' \
-p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args/1", "value": "--auto-instrumentation-java-image=${{ env.APPLICATION_SIGNALS_ADOT_IMAGE }}"}]'
kubectl delete pods --all -n amazon-cloudwatch
sleep 10
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
# Application pods need to be restarted for the
Expand Down Expand Up @@ -205,10 +223,10 @@ jobs:
- name: Call all test APIs
continue-on-error: true
run: |
curl -S -s -o /dev/null http://${{ env.APP_ENDPOINT }}/outgoing-http-call/; echo
curl -S -s -o /dev/null http://${{ env.APP_ENDPOINT }}/aws-sdk-call/; echo
curl -S -s -o /dev/null http://${{ env.APP_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_POD_IP }}/; echo
curl -S -s -o /dev/null http://${{ env.APP_ENDPOINT }}/client-call/; echo
curl -S -s "http://${{ env.APP_ENDPOINT }}/outgoing-http-call"
curl -S -s "http://${{ env.APP_ENDPOINT }}/aws-sdk-call?ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}"
curl -S -s "http://${{ env.APP_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}"
curl -S -s "http://${{ env.APP_ENDPOINT }}/client-call"
- name: Build Gradle
run: ./gradlew
Expand All @@ -228,7 +246,7 @@ jobs:
--platform-info ${{ inputs.test-java-cluster-name }}
--service-name sample-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

- name: Call endpoints and validate generated metrics
Expand All @@ -246,7 +264,7 @@ jobs:
--service-name sample-application-${{ env.TESTING_ID }}
--remote-service-name sample-remote-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

- name: Call endpoints and validate generated traces
Expand All @@ -263,7 +281,7 @@ jobs:
--platform-info ${{ inputs.test-java-cluster-name }}
--service-name sample-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

# Clean up Procedures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ env:
SAMPLE_APP_NAMESPACE: python-sample-app-namespace
APP_SIGNALS_PYTHON_E2E_FE_SA_IMG: appsignals-python-django-main-service
APP_SIGNALS_PYTHON_E2E_RE_SA_IMG: appsignals-python-django-remote-service
METRIC_NAMESPACE: AppSignals
LOG_GROUP: /aws/appsignals/eks
METRIC_NAMESPACE: ApplicationSignals
LOG_GROUP: /aws/application-signals/data
ECR_OPERATOR_STAGING_REPO: ${{ vars.ECR_OPERATOR_STAGING_REPO }}

APPLICATION_SIGNALS_ADOT_IMAGE: 637423224110.dkr.ecr.us-east-1.amazonaws.com/aws-observability/adot-autoinstrumentation-python-staging:0.2.0-408d938
APPLICATION_SIGNALS_CW_AGENT_IMAGE: 506463145083.dkr.ecr.us-west-2.amazonaws.com/cwagent-integration-test:00ef994d0feaa8ebe03da61cd9fcfcc1f20ca650

jobs:
appsignals-e2e-test:
appsignals-python-e2e-test:
runs-on: ubuntu-latest
steps:
- name: Download enablement script
Expand Down Expand Up @@ -99,7 +100,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: aws-observability/aws-application-signals-test-framework
ref: main
ref: ga-python
path: aws-application-signals-test-framework

- name: Set up terraform
Expand Down Expand Up @@ -141,6 +142,22 @@ jobs:
run: |
kubectl patch deploy -n amazon-cloudwatch amazon-cloudwatch-observability-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "${{ env.ECR_OPERATOR_STAGING_REPO }}:${{ inputs.tag }}"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]]'
kubectl delete pods --all -n amazon-cloudwatch
sleep 10
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
- name: Patch the CloudWatch Agent image and restart CloudWatch pods
run: |
kubectl patch amazoncloudwatchagents -n amazon-cloudwatch cloudwatch-agent --type='json' -p='[{"op": "replace", "path": "/spec/image", "value": "${{ env.APPLICATION_SIGNALS_CW_AGENT_IMAGE }}"}]'
kubectl delete pods --all -n amazon-cloudwatch
sleep 10
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
- name: Patch the ADOT image and restart CloudWatch pods
run: |
kubectl patch deploy -namazon-cloudwatch amazon-cloudwatch-observability-controller-manager --type='json' \
-p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args/2", "value": "--auto-instrumentation-python-image=${{ env.APPLICATION_SIGNALS_ADOT_IMAGE }}"}]'
kubectl delete pods --all -n amazon-cloudwatch
sleep 10
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
# Application pods need to be restarted for the
Expand Down Expand Up @@ -211,10 +228,10 @@ jobs:
- name: Call all test APIs
continue-on-error: true
run: |
curl -S -s -o /dev/null http://${{ env.APP_ENDPOINT }}/outgoing-http-call
curl -S -s -o /dev/null http://${{ env.APP_ENDPOINT }}/aws-sdk-call
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
curl -S -s -o /dev/null "http://${{ env.APP_ENDPOINT }}/outgoing-http-call"; echo
curl -S -s -o /dev/null "http://${{ env.APP_ENDPOINT }}/aws-sdk-call?ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}"; echo
curl -S -s -o /dev/null "http://${{ env.APP_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}"; echo
curl -S -s -o /dev/null "http://${{ env.APP_ENDPOINT }}/client-call"; echo
# Validation for app signals telemetry data
- name: Call endpoint and validate generated EMF logs
Expand All @@ -232,7 +249,7 @@ jobs:
--platform-info ${{ inputs.test-python-cluster-name }}
--service-name python-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

- name: Call endpoints and validate generated metrics
Expand All @@ -249,9 +266,9 @@ jobs:
--app-namespace ${{ env.SAMPLE_APP_NAMESPACE }}
--platform-info ${{ inputs.test-python-cluster-name }}
--service-name python-application-${{ env.TESTING_ID }}
--remote-service-name sample-remote-application-${{ env.TESTING_ID }}
--remote-service-name python-remote-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

- name: Call endpoints and validate generated traces
Expand All @@ -263,13 +280,12 @@ jobs:
--endpoint http://${{ env.APP_ENDPOINT }}
--region ${{ env.AWS_DEFAULT_REGION }}
--account-id ${{ env.TEST_ACCOUNT }}
--metric-namespace ${{ env.METRIC_NAMESPACE }}
--log-group ${{ env.LOG_GROUP }}
--app-namespace ${{ env.SAMPLE_APP_NAMESPACE }}
--platform-info ${{ inputs.test-python-cluster-name }}
--service-name python-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

# Clean up Procedures
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-upload-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:

e2e-test:
needs: MakeBinary
uses: ./.github/workflows/appsignals-e2e-test.yml
uses: ./.github/workflows/application-signals-e2e-test.yml
secrets: inherit
with:
test-java-cluster-name: 'e2e-cw-agent-operator-test'
Expand Down

0 comments on commit d54f5dc

Please sign in to comment.