1+ # # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ # # SPDX-License-Identifier: Apache-2.0
3+
4+ # This is a reusable workflow for running the Enablement test for App Signals.
5+ # It is meant to be called from another workflow.
6+ # Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview
7+ name : Java EKS OTLP/OCB Use Case
8+ on :
9+ workflow_call :
10+ inputs :
11+ aws-region :
12+ required : true
13+ type : string
14+ test-cluster-name :
15+ required : true
16+ type : string
17+ caller-workflow-name :
18+ required : true
19+ type : string
20+ java-version :
21+ description : " Currently support version 8, 11, 17, 21, 22"
22+ required : false
23+ type : string
24+ default : ' 11'
25+ adot-image-name :
26+ required : false
27+ type : string
28+ cw-agent-operator-tag :
29+ required : false
30+ type : string
31+ outputs :
32+ job-started :
33+ value : ${{ jobs.metric-limiter.outputs.job-started }}
34+ validation-result :
35+ value : ${{ jobs.metric-limiter.outputs.validation-result }}
36+
37+ permissions :
38+ id-token : write
39+ contents : read
40+
41+ env :
42+ # The precense of this env var is required for use by terraform and AWS CLI commands
43+ # It is not redundant
44+ E2E_TEST_AWS_REGION : ${{ inputs.aws-region }}
45+ CLUSTER_NAME : ${{ inputs.test-cluster-name }}
46+ CALLER_WORKFLOW_NAME : ${{ inputs.caller-workflow-name }}
47+ JAVA_VERSION : ${{ inputs.java-version }}
48+ ADOT_IMAGE_NAME : ${{ inputs.adot-image-name }}
49+ CW_AGENT_OPERATOR_TAG : ${{ inputs.cw-agent-operator-tag }}
50+ E2E_TEST_ACCOUNT_ID : ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
51+ E2E_TEST_ROLE_NAME : ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
52+ METRIC_NAMESPACE : ApplicationSignals
53+ LOG_GROUP_NAME : /aws/application-signals/data
54+ TEST_RESOURCES_FOLDER : ${GITHUB_WORKSPACE}
55+
56+ jobs :
57+ otlp-ocb :
58+ runs-on : ubuntu-latest
59+ timeout-minutes : 30
60+ outputs :
61+ job-started : ${{ steps.job-started.outputs.job-started }}
62+ validation-result : ${{ steps.validation-result.outputs.validation-result }}
63+ steps :
64+ - name : Check if the job started
65+ id : job-started
66+ run : echo "job-started=true" >> $GITHUB_OUTPUT
67+
68+ - name : Configure AWS Credentials
69+ uses : aws-actions/configure-aws-credentials@v4
70+ with :
71+ role-to-assume : arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
72+ aws-region : us-east-1
73+
74+ - name : Retrieve account
75+ uses : aws-actions/aws-secretsmanager-get-secrets@v2
76+ with :
77+ secret-ids : |
78+ ACCOUNT_ID, region-account/${{ env.E2E_TEST_AWS_REGION }}
79+ JAVA_MAIN_SAMPLE_APP_IMAGE, e2e-test/java-main-sample-app-image
80+ JAVA_REMOTE_SAMPLE_APP_IMAGE, e2e-test/java-remote-sample-app-image
81+
82+ # If the workflow is running as a canary, then we want to log in to the aws account in the appropriate region
83+ - name : Configure AWS Credentials
84+ if : ${{ github.event.repository.name == 'aws-application-signals-test-framework' }}
85+ uses : aws-actions/configure-aws-credentials@v4
86+ with :
87+ role-to-assume : arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
88+ aws-region : ${{ env.E2E_TEST_AWS_REGION }}
89+
90+ - name : Validate traces
91+ id : trace-validation
92+ run : echo "TEST"
93+
94+ - name : Refresh AWS Credentials
95+ if : ${{ github.event.repository.name == 'aws-application-signals-test-framework' }}
96+ uses : aws-actions/configure-aws-credentials@v4
97+ with :
98+ role-to-assume : arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
99+ aws-region : ${{ env.E2E_TEST_AWS_REGION }}
100+
101+ - name : Save test results
102+ if : always()
103+ id : validation-result
104+ run : |
105+ if [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
106+ echo "validation-result=success" >> $GITHUB_OUTPUT
107+ else
108+ echo "validation-result=failure" >> $GITHUB_OUTPUT
109+ fi
0 commit comments