15
15
required : true
16
16
type : string
17
17
18
+ concurrency :
19
+ group : ' ${{ github.workflow }} @ ${{ inputs.aws-region }}'
20
+ cancel-in-progress : false
21
+
18
22
permissions :
19
23
id-token : write
20
24
contents : read
26
30
TEST_ACCOUNT : ${{ secrets.APP_SIGNALS_E2E_TEST_ACC }}
27
31
METRIC_NAMESPACE : AppSignals
28
32
LOG_GROUP_NAME : /aws/appsignals/k8s
29
- TEST_RESOURCES_FOLDER : /home/runner/work/aws-application-signals-test-framework/aws-application-signals-test-framework
30
33
MASTER_NODE_SSH_KEY : ${{ secrets.APP_SIGNALS_E2E_K8S_SSH_KEY_IAD }}
31
34
MAIN_SERVICE_ENDPOINT : ${{ secrets.APP_SIGNALS_E2E_K8S_MASTER_NODE_ENDPOINT }}
32
35
SAMPLE_APP_NAMESPACE : sample-app-namespace
33
-
36
+ TEST_RESOURCES_FOLDER : /__w/aws-application-signals-test-framework/aws-application-signals-test-framework
34
37
35
38
jobs :
36
39
e2e-k8s-test :
37
40
runs-on : ubuntu-latest
41
+ container :
42
+ image : public.ecr.aws/h6o3z5z9/aws-application-signals-test-framework-workflow-container:latest
38
43
steps :
39
44
- uses : actions/checkout@v4
40
45
with :
41
46
fetch-depth : 0
42
47
43
48
- name : Generate testing id
44
- run : echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
49
+ run : echo TESTING_ID="${{ env.AWS_DEFAULT_REGION }}-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
45
50
46
51
- name : Configure AWS Credentials
47
52
uses : aws-actions/configure-aws-credentials@v4
70
75
sed -i 's#\${IMAGE}#${{ env.ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_DEFAULT_REGION }}.amazonaws.com/${{ secrets.APP_SIGNALS_E2E_RE_SA_IMG }}#' remote-service-depl.yaml
71
76
aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ env.AWS_DEFAULT_REGION }} --key frontend-service-depl.yaml --body frontend-service-depl.yaml
72
77
aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ env.AWS_DEFAULT_REGION }} --key remote-service-depl.yaml --body remote-service-depl.yaml
73
-
74
-
75
- - name : Set up terraform
76
- uses : ./.github/workflows/actions/execute_and_retry
77
- with :
78
- command : " wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg"
79
- post-command : ' echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
80
- && sudo apt update && sudo apt install terraform'
81
78
82
- - name : Initiate Terraform for Deployment
79
+ - name : Initiate Terraform
83
80
uses : ./.github/workflows/actions/execute_and_retry
84
81
with :
85
82
command : " cd ${{ env.TEST_RESOURCES_FOLDER }}/terraform/k8s/deploy && terraform init && terraform validate"
@@ -98,22 +95,15 @@ jobs:
98
95
run : |
99
96
echo REMOTE_SERVICE_IP="$(aws ssm get-parameter --region ${{ env.AWS_DEFAULT_REGION }} --name remote-service-ip | jq -r '.Parameter.Value')" >> $GITHUB_ENV
100
97
101
- - name : Build Gradlew
102
- uses : ./.github/workflows/actions/execute_and_retry
103
- with :
104
- max_retry : 2
105
- command : " ./gradlew"
106
- cleanup : " ./gradlew clean"
107
-
108
98
# This steps increases the speed of the validation by creating the telemetry data in advance
109
99
# It is run after the gradle build to give the app time to initialize after the pods become ready
110
100
- name : Call all test APIs
111
101
continue-on-error : true
112
102
run : |
113
- curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/outgoing-http-call/
114
- curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/aws-sdk-call/
115
- curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}/
116
- curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/client-call/
103
+ curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/outgoing-http-call/; echo
104
+ curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/aws-sdk-call/; echo
105
+ curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}/; echo
106
+ curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/client-call/; echo
117
107
118
108
# Validation for pulse telemetry data
119
109
- name : Validate generated EMF logs
@@ -171,7 +161,7 @@ jobs:
171
161
- name : Publish metric on test result
172
162
if : always()
173
163
run : |
174
- if [[ "${{ steps.log-validation.outcome }}" == "success" && "${{ steps.metric-validation.outcome }}" == "success" && "${{ steps.trace-validation.outcome }}" == "success" ] ]; then
164
+ if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
175
165
aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \
176
166
--metric-name Failure \
177
167
--dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=${{ inputs.caller-workflow-name }} \
@@ -198,7 +188,7 @@ jobs:
198
188
working-directory : terraform/k8s/cleanup
199
189
run : |
200
190
terraform apply -auto-approve \
201
- -var="aws_region=${{ inputs.aws-region }}" \
191
+ -var="aws_region=${{ env.AWS_DEFAULT_REGION }}" \
202
192
-var="test_id=${{ env.TESTING_ID }}" \
203
193
-var="ssh_key=${{ env.MASTER_NODE_SSH_KEY }}" \
204
194
-var="host=${{ env.MAIN_SERVICE_ENDPOINT }}"
0 commit comments