diff --git a/.github/workflows/application-signals-e2e-test.yml b/.github/workflows/application-signals-e2e-test.yml new file mode 100644 index 0000000000..c0d3755790 --- /dev/null +++ b/.github/workflows/application-signals-e2e-test.yml @@ -0,0 +1,82 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +# This is a reusable workflow for running the E2E test for Application Signals. +# It is meant to be called from another workflow. +# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview +name: E2E Testing +on: + workflow_call: + inputs: + adot-image-name: + required: true + type: string + +permissions: + id-token: write + contents: read + +concurrency: + group: '${{ github.workflow }} @ ${{ inputs.aws-region }}' + cancel-in-progress: false + + +jobs: + upload-main-build: + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} + aws-region: us-east-1 + + - uses: actions/download-artifact@v3 + with: + name: aws-opentelemetry-agent.jar + + - name: Upload main-build adot.jar to s3 + run: aws s3 cp ./aws-opentelemetry-agent-*-SNAPSHOT.jar s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar + + java-ec2-default-e2e-test: + needs: [ upload-main-build ] + uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-e2e-test.yml@consolidate-release + secrets: inherit + with: + aws-region: us-east-1 + caller-workflow-name: 'main-build' + + java-ec2-asg-e2e-test: + needs: [ upload-main-build ] + uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-asg-e2e-test.yml@consolidate-release + secrets: inherit + with: + aws-region: us-east-1 + caller-workflow-name: 'main-build' + + java-eks-e2e-test: + uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-e2e-test.yml@consolidate-release + secrets: inherit + with: + aws-region: us-east-1 + test-cluster-name: 'e2e-adot-test' + adot-image-name: ${{ inputs.adot-image-name }} + caller-workflow-name: 'main-build' + + java-metric-limiter-e2e-test: + needs: [ java-eks-e2e-test ] + uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-e2e-test.yml@consolidate-release + secrets: inherit + with: + aws-region: us-east-1 + test-cluster-name: 'e2e-adot-test' + adot-image-name: ${{ inputs.adot-image-name }} + caller-workflow-name: 'main-build' + + java-k8s-e2e-test: + uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-k8s-e2e-test.yml@consolidate-release + secrets: inherit + with: + aws-region: us-east-1 + adot-image-name: ${{ inputs.adot-image-name }} + caller-workflow-name: 'main-build' \ No newline at end of file diff --git a/.github/workflows/appsignals-e2e-ec2-test.yml b/.github/workflows/appsignals-e2e-ec2-test.yml deleted file mode 100644 index 32ff0bfc14..0000000000 --- a/.github/workflows/appsignals-e2e-ec2-test.yml +++ /dev/null @@ -1,189 +0,0 @@ -# This is a reusable workflow for running the E2E test for App Signals. -# It is meant to be called from another workflow. -# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview -name: App Signals Enablement E2E Testing - EC2 Use Case -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - -permissions: - id-token: write - contents: read - -env: - # The precense of this env var is required for use by terraform and AWS CLI commands - # It is not redundant - AWS_DEFAULT_REGION: ${{ inputs.aws-region }} - TEST_ACCOUNT: ${{ secrets.APP_SIGNALS_E2E_TEST_ACC }} - SAMPLE_APP_FRONTEND_SERVICE_JAR: ${{ secrets.APP_SIGNALS_E2E_FE_SA_JAR }} - SAMPLE_APP_REMOTE_SERVICE_JAR: ${{ secrets.APP_SIGNALS_E2E_RE_SA_JAR }} - GET_CW_AGENT_RPM_COMMAND: "wget -O cw-agent.rpm https://amazoncloudwatch-agent-us-east-1.s3.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm" - GET_ADOT_JAR_COMMAND: "aws s3 cp s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar ./adot.jar" - METRIC_NAMESPACE: AppSignals - LOG_GROUP_NAME: /aws/appsignals/generic - -jobs: - e2e-ec2-test: - runs-on: ubuntu-latest - steps: - - name: Get testing resources from aws-application-signals-test-framework - uses: actions/checkout@v4 - with: - repository: aws-observability/aws-application-signals-test-framework - ref: adot-pending-release - - - name: Generate testing id - run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.E2E_TEST_ROLE_ARN }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - - uses: actions/download-artifact@v3 - with: - name: aws-opentelemetry-agent.jar - - - name: Upload main-build adot.jar to s3 - run: aws s3 cp ./aws-opentelemetry-agent-*-SNAPSHOT.jar s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar - - - name: Set up terraform - uses: hashicorp/setup-terraform@v3 - with: - terraform_wrapper: false - - - name: Deploy sample app via terraform - working-directory: terraform/ec2 - run: | - terraform init - terraform validate - terraform apply -auto-approve \ - -var="aws_region=${{ env.AWS_DEFAULT_REGION }}" \ - -var="test_id=${{ env.TESTING_ID }}" \ - -var="sample_app_jar=${{ env.SAMPLE_APP_FRONTEND_SERVICE_JAR }}" \ - -var="sample_remote_app_jar=${{ env.SAMPLE_APP_REMOTE_SERVICE_JAR }}" \ - -var="get_cw_agent_rpm_command=${{ env.GET_CW_AGENT_RPM_COMMAND }}" \ - -var="get_adot_jar_command=${{ env.GET_ADOT_JAR_COMMAND }}" - - - name: Get the ec2 instance ami id - run: | - echo "EC2_INSTANCE_AMI=$(terraform output ec2_instance_ami)" >> $GITHUB_ENV - working-directory: terraform/ec2 - - - name: Get the sample app endpoint - run: | - echo "MAIN_SERVICE_ENDPOINT=$(terraform output sample_app_main_service_public_dns):8080" >> $GITHUB_ENV - echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_public_ip)" >> $GITHUB_ENV - working-directory: terraform/ec2 - - - name: Wait for app endpoint to come online - id: endpoint-check - run: | - attempt_counter=0 - max_attempts=30 - until $(curl --output /dev/null --silent --head --fail http://${{ env.MAIN_SERVICE_ENDPOINT }}); do - if [ ${attempt_counter} -eq ${max_attempts} ];then - echo "Max attempts reached" - exit 1 - fi - - printf '.' - attempt_counter=$(($attempt_counter+1)) - sleep 10 - done - - # This steps increases the speed of the validation by creating the telemetry data in advance - - name: Call all test APIs - continue-on-error: true - run: | - curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/outgoing-http-call/; echo - curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/aws-sdk-call?ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}" - curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}" - curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call/; echo - - - name: Build Gradle - run: ./gradlew - - # Validation for pulse telemetry data - - name: Validate generated EMF logs - id: log-validation - run: ./gradlew validator:run --args='-c ec2/log-validation.yml - --testing-id ${{ env.TESTING_ID }} - --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - --region ${{ env.AWS_DEFAULT_REGION }} - --account-id ${{ env.TEST_ACCOUNT }} - --metric-namespace ${{ env.METRIC_NAMESPACE }} - --log-group ${{ env.LOG_GROUP_NAME }} - --service-name sample-application-${{ env.TESTING_ID }} - --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - --instance-ami ${{ env.EC2_INSTANCE_AMI }} - --rollup' - - - name: Validate generated metrics - id: metric-validation - if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() - run: ./gradlew validator:run --args='-c ec2/metric-validation.yml - --testing-id ${{ env.TESTING_ID }} - --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - --region ${{ env.AWS_DEFAULT_REGION }} - --account-id ${{ env.TEST_ACCOUNT }} - --metric-namespace ${{ env.METRIC_NAMESPACE }} - --log-group ${{ env.LOG_GROUP_NAME }} - --service-name sample-application-${{ env.TESTING_ID }} - --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - --instance-ami ${{ env.EC2_INSTANCE_AMI }} - --rollup' - - - name: Validate generated traces - id: trace-validation - if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() - run: ./gradlew validator:run --args='-c ec2/trace-validation.yml - --testing-id ${{ env.TESTING_ID }} - --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - --region ${{ env.AWS_DEFAULT_REGION }} - --account-id ${{ env.TEST_ACCOUNT }} - --metric-namespace ${{ env.METRIC_NAMESPACE }} - --log-group ${{ env.LOG_GROUP_NAME }} - --service-name sample-application-${{ env.TESTING_ID }} - --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - --instance-ami ${{ env.EC2_INSTANCE_AMI }} - --rollup' - - - name: Publish metric on test result - if: always() - run: | - if [[ "${{ steps.log-validation.outcome }}" == "success" && "${{ steps.metric-validation.outcome }}" == "success" && "${{ steps.trace-validation.outcome }}" == "success" ]]; then - aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \ - --metric-name Failure \ - --dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=${{ inputs.caller-workflow-name }} \ - --value 0.0 \ - --region ${{ env.AWS_DEFAULT_REGION }} - else - aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \ - --metric-name Failure \ - --dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=${{ inputs.caller-workflow-name }} \ - --value 1.0 \ - --region ${{ env.AWS_DEFAULT_REGION }} - fi - - # Clean up Procedures - - name: Terraform destroy - if: always() - continue-on-error: true - working-directory: terraform/ec2 - run: | - terraform destroy -auto-approve \ - -var="test_id=${{ env.TESTING_ID }}" \ No newline at end of file diff --git a/.github/workflows/appsignals-e2e-eks-test.yml b/.github/workflows/appsignals-e2e-eks-test.yml deleted file mode 100644 index bab126d7a6..0000000000 --- a/.github/workflows/appsignals-e2e-eks-test.yml +++ /dev/null @@ -1,305 +0,0 @@ -# This is a reusable workflow for running the E2E test for App Signals. -# It is meant to be called from another workflow. -# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview -name: App Signals Enablement E2E Testing - EKS -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - test-cluster-name: - required: true - type: string - appsignals-adot-image-name: - required: false - type: string - caller-workflow-name: - required: true - type: string - -permissions: - id-token: write - contents: read - -env: - # The precense of this env var is required for use by terraform and AWS CLI commands - # It is not redundant - AWS_DEFAULT_REGION: ${{ inputs.aws-region }} - TEST_ACCOUNT: ${{ secrets.APP_SIGNALS_E2E_TEST_ACC }} - SAMPLE_APP_NAMESPACE: sample-app-namespace - SAMPLE_APP_FRONTEND_SERVICE_IMAGE: ${{ secrets.APP_SIGNALS_E2E_FE_SA_IMG }} - SAMPLE_APP_REMOTE_SERVICE_IMAGE: ${{ secrets.APP_SIGNALS_E2E_RE_SA_IMG }} - METRIC_NAMESPACE: AppSignals - LOG_GROUP_NAME: /aws/appsignals/eks - -jobs: - e2e-eks-test: - runs-on: ubuntu-latest - steps: - - name: Get testing resources from aws-application-signals-test-framework - uses: actions/checkout@v4 - with: - repository: aws-observability/aws-application-signals-test-framework - ref: adot-pending-release - - - name: Download enablement script - uses: actions/checkout@v4 - with: - repository: aws-observability/application-signals-demo - ref: main - path: enablement-script - sparse-checkout: | - scripts/eks/appsignals/enable-app-signals.sh - scripts/eks/appsignals/clean-app-signals.sh - sparse-checkout-cone-mode: false - - - name: Remove log group deletion command - if: always() - working-directory: enablement-script/scripts/eks/appsignals - run: | - delete_log_group="aws logs delete-log-group --log-group-name '${{ env.LOG_GROUP_NAME }}' --region \$REGION" - sed -i "s#$delete_log_group##g" clean-app-signals.sh - - - 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.E2E_TEST_ROLE_ARN }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - # local directory to store the kubernetes config - - name: Create kubeconfig directory - run: mkdir -p ${{ github.workspace }}/.kube - - - name: Set KUBECONFIG environment variable - run: echo KUBECONFIG="${{ github.workspace }}/.kube/config" >> $GITHUB_ENV - - - name: Set up kubeconfig - run: aws eks update-kubeconfig --name ${{ inputs.test-cluster-name }} --region ${{ env.AWS_DEFAULT_REGION }} - - - name: Install eksctl - run: | - mkdir ${{ github.workspace }}/eksctl - curl -sLO "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_Linux_amd64.tar.gz" - tar -xzf eksctl_Linux_amd64.tar.gz -C ${{ github.workspace }}/eksctl && rm eksctl_Linux_amd64.tar.gz - echo "${{ github.workspace }}/eksctl" >> $GITHUB_PATH - - - name: Create role for AWS access from the sample app - id: create_service_account - run: | - eksctl create iamserviceaccount \ - --name service-account-${{ env.TESTING_ID }} \ - --namespace ${{ env.SAMPLE_APP_NAMESPACE }} \ - --cluster ${{ inputs.test-cluster-name }} \ - --role-name eks-s3-access-${{ env.TESTING_ID }} \ - --attach-policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess \ - --region ${{ env.AWS_DEFAULT_REGION }} \ - --approve - - - name: Set up terraform - uses: hashicorp/setup-terraform@v3 - with: - terraform_wrapper: false - - - name: Deploy sample app via terraform - working-directory: terraform/eks - run: | - terraform init - terraform validate - terraform apply -auto-approve \ - -var="test_id=${{ env.TESTING_ID }}" \ - -var="aws_region=${{ env.AWS_DEFAULT_REGION }}" \ - -var="kube_directory_path=${{ github.workspace }}/.kube" \ - -var="eks_cluster_name=${{ inputs.test-cluster-name }}" \ - -var="eks_cluster_context_name=$(kubectl config current-context)" \ - -var="test_namespace=${{ env.SAMPLE_APP_NAMESPACE }}" \ - -var="service_account_aws_access=service-account-${{ env.TESTING_ID }}" \ - -var="sample_app_image=${{ env.SAMPLE_APP_FRONTEND_SERVICE_IMAGE }}" \ - -var="sample_remote_app_image=${{ env.SAMPLE_APP_REMOTE_SERVICE_IMAGE }}" - - # Enable App Signals on the test cluster - - name: Enable App Signals - working-directory: enablement-script/scripts/eks/appsignals - run: | - ./enable-app-signals.sh \ - ${{ inputs.test-cluster-name }} \ - ${{ env.AWS_DEFAULT_REGION }} \ - ${{ env.SAMPLE_APP_NAMESPACE }} - - - 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=${{ inputs.appsignals-adot-image-name }}"}]' - kubectl delete pods --all -n amazon-cloudwatch - sleep 5 - kubectl wait --for=condition=Ready pod --request-timeout '5m' --all -n amazon-cloudwatch - - - name: Restart the app pods - run: kubectl delete pods --all -n ${{ env.SAMPLE_APP_NAMESPACE }} - - - name: Wait for sample app pods to come up - run: | - kubectl wait --for=condition=Ready pod --all -n ${{ env.SAMPLE_APP_NAMESPACE }} - - - name: Get remote service pod name and IP - run: | - echo "REMOTE_SERVICE_DEPLOYMENT_NAME=$(kubectl get deployments -n ${{ env.SAMPLE_APP_NAMESPACE }} --selector=app=remote-app -o jsonpath='{.items[0].metadata.name}')" >> $GITHUB_ENV - echo "REMOTE_SERVICE_POD_IP=$(kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} --selector=app=remote-app -o jsonpath='{.items[0].status.podIP}')" >> $GITHUB_ENV - - - name: Verify pod Adot image - run: | - kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} --output json | \ - jq '.items[0].status.initContainerStatuses[0].imageID' - - - name: Verify pod CWAgent image - run: | - kubectl get pods -n amazon-cloudwatch --output json | \ - jq '.items[0].status.containerStatuses[0].imageID' - - - name: Get the sample app endpoint - run: echo "APP_ENDPOINT=$(terraform output sample_app_endpoint)" >> $GITHUB_ENV - working-directory: terraform/eks - - - name: Wait for app endpoint to come online - id: endpoint-check - run: | - attempt_counter=0 - max_attempts=30 - until $(curl --output /dev/null --silent --head --fail http://${{ env.APP_ENDPOINT }}); do - if [ ${attempt_counter} -eq ${max_attempts} ];then - echo "Max attempts reached" - exit 1 - fi - - printf '.' - attempt_counter=$(($attempt_counter+1)) - sleep 10 - done - - # This steps increases the speed of the validation by creating the telemetry data in advance - - name: Call all test APIs - continue-on-error: true - run: | - curl -S -s http://${{ env.APP_ENDPOINT }}/outgoing-http-call/; echo - 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/; echo - - - 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 validator:run --args='-c eks/log-validation.yml - --testing-id ${{ env.TESTING_ID }} - --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_NAME }} - --app-namespace ${{ env.SAMPLE_APP_NAMESPACE }} - --platform-info ${{ inputs.test-cluster-name }} - --service-name sample-application-${{ env.TESTING_ID }} - --remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }} - --query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }} - --rollup' - - - name: Call endpoints and validate generated metrics - id: metric-validation - if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() - 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 }} - --account-id ${{ env.TEST_ACCOUNT }} - --metric-namespace ${{ env.METRIC_NAMESPACE }} - --log-group ${{ env.LOG_GROUP_NAME }} - --app-namespace ${{ env.SAMPLE_APP_NAMESPACE }} - --platform-info ${{ inputs.test-cluster-name }} - --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 }} - --query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }} - --rollup' - - - 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 validator:run --args='-c eks/trace-validation.yml - --testing-id ${{ env.TESTING_ID }} - --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_NAME }} - --app-namespace ${{ env.SAMPLE_APP_NAMESPACE }} - --platform-info ${{ inputs.test-cluster-name }} - --service-name sample-application-${{ env.TESTING_ID }} - --remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }} - --query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }} - --rollup' - - - name: Publish metric on test result - if: always() - run: | - if [[ "${{ steps.log-validation.outcome }}" == "success" && "${{ steps.metric-validation.outcome }}" == "success" && "${{ steps.trace-validation.outcome }}" == "success" ]]; then - aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \ - --metric-name Failure \ - --dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=${{ inputs.caller-workflow-name }} \ - --value 0.0 \ - --region ${{ env.AWS_DEFAULT_REGION }} - else - aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \ - --metric-name Failure \ - --dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=${{ inputs.caller-workflow-name }} \ - --value 1.0 \ - --region ${{ env.AWS_DEFAULT_REGION }} - fi - - # Clean up Procedures - - - name: Clean Up App Signals - if: always() - continue-on-error: true - working-directory: enablement-script/scripts/eks/appsignals - run: | - ./clean-app-signals.sh \ - ${{ inputs.test-cluster-name }} \ - ${{ env.AWS_DEFAULT_REGION }} \ - ${{ env.SAMPLE_APP_NAMESPACE }} - - # This step also deletes lingering resources from previous test runs - - name: Delete all sample app resources - if: always() - continue-on-error: true - timeout-minutes: 10 - run: kubectl delete namespace ${{ env.SAMPLE_APP_NAMESPACE }} - - - name: Terraform destroy - if: always() - continue-on-error: true - working-directory: terraform/eks - run: | - terraform destroy -auto-approve \ - -var="test_id=${{ env.TESTING_ID }}" \ - -var="aws_region=${{ env.AWS_DEFAULT_REGION }}" \ - -var="kube_directory_path=${{ github.workspace }}/.kube" \ - -var="eks_cluster_name=${{ inputs.test-cluster-name }}" \ - -var="test_namespace=${{ env.SAMPLE_APP_NAMESPACE }}" \ - -var="service_account_aws_access=service-account-${{ env.TESTING_ID }}" \ - -var="sample_app_image=${{ env.SAMPLE_APP_IMAGE }}" - - - name: Remove aws access service account - if: always() - continue-on-error: true - run: | - eksctl delete iamserviceaccount \ - --name service-account-${{ env.TESTING_ID }} \ - --namespace ${{ env.SAMPLE_APP_NAMESPACE }} \ - --cluster ${{ inputs.test-cluster-name }} \ - --region ${{ env.AWS_DEFAULT_REGION }} diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index f990cb63ad..4ac6563872 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -223,28 +223,12 @@ jobs: with: arguments: contractTests -PlocalDocker=true - # AppSignals specific e2e tests - appsignals-e2e-eks-test: - concurrency: - group: e2e-adot-test - cancel-in-progress: false - needs: [build, default-region-output] - uses: ./.github/workflows/appsignals-e2e-eks-test.yml + application-signals-e2e-test: + needs: [build] + uses: ./.github/workflows/application-signals-e2e-test.yml secrets: inherit with: - aws-region: ${{ needs.default-region-output.outputs.aws_default_region }} - test-cluster-name: "e2e-adot-test" - appsignals-adot-image-name: ${{ needs.build.outputs.staging-image }} - caller-workflow-name: 'main-build' - - # AppSignals specific e2e tests for ec2 - appsignals-e2e-ec2-test: - needs: [build, default-region-output] - uses: ./.github/workflows/appsignals-e2e-ec2-test.yml - secrets: inherit - with: - aws-region: ${{ needs.default-region-output.outputs.aws_default_region }} - caller-workflow-name: 'main-build' + adot-image-name: ${{ needs.build.outputs.staging-image }} publish-build-status: needs: [ build, contract-tests ]