Skip to content

Commit debb2a2

Browse files
committed
update github workflows for new test cases
1 parent 834cbdb commit debb2a2

File tree

7 files changed

+25
-22
lines changed

7 files changed

+25
-22
lines changed

.github/workflows/appsignals-e2e-ec2-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ jobs:
166166
- name: Call all test APIs
167167
continue-on-error: true
168168
run: |
169-
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/outgoing-http-call/
170-
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/aws-sdk-call/
171-
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}/
172-
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call/
169+
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/outgoing-http-call
170+
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/aws-sdk-call?testingId=${{ env.TESTING_ID }}
171+
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}
172+
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call
173173
174174
# Validation for pulse telemetry data
175175
- name: Validate generated EMF logs
@@ -201,7 +201,7 @@ jobs:
201201
--log-group ${{ env.LOG_GROUP_NAME }}
202202
--service-name sample-application-${{ env.TESTING_ID }}
203203
--remote-service-name sample-remote-application-${{ env.TESTING_ID }}
204-
--request-body ip=${{ env.REMOTE_SERVICE_IP }}
204+
--request-body ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}
205205
--instance-ami ${{ env.EC2_INSTANCE_AMI }}
206206
--rollup'
207207

.github/workflows/appsignals-e2e-eks-test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
test-cluster-name:
1515
required: true
1616
type: string
17-
appsignals-adot-image-name:
17+
application-signals-adot-image:
1818
required: false
1919
type: string
2020
caller-workflow-name:
@@ -253,10 +253,10 @@ jobs:
253253
- name: Call all test APIs
254254
continue-on-error: true
255255
run: |
256-
curl -S -s http://${{ env.APP_ENDPOINT }}/outgoing-http-call/
257-
curl -S -s http://${{ env.APP_ENDPOINT }}/aws-sdk-call/
258-
curl -S -s http://${{ env.APP_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_POD_IP }}/
259-
curl -S -s http://${{ env.APP_ENDPOINT }}/client-call/
256+
curl -S -s http://${{ env.APP_ENDPOINT }}/outgoing-http-call
257+
curl -S -s http://${{ env.APP_ENDPOINT }}/aws-sdk-call?testingId=${{ env.TESTING_ID }}
258+
curl -S -s http://${{ env.APP_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_POD_IP }}
259+
curl -S -s http://${{ env.APP_ENDPOINT }}/client-call
260260
261261
# Validation for app signals telemetry data
262262
- name: Call endpoint and validate generated EMF logs
@@ -291,7 +291,7 @@ jobs:
291291
--service-name sample-application-${{ env.TESTING_ID }}
292292
--remote-service-name sample-remote-application-${{ env.TESTING_ID }}
293293
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
294-
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}
294+
--request-body ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
295295
--rollup'
296296

297297
- name: Call endpoints and validate generated traces

terraform/ec2/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ resource "null_resource" "remote_service_setup" {
177177
"echo $agent_config > amazon-cloudwatch-agent.json",
178178

179179
# Get and run CW agent rpm
180-
"${var.get_cw_agent_rpm_command}",
180+
"${var.get_cw_agent_rpm_command}",
181181
"sudo rpm -U ./cw-agent.rpm",
182182
"sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:./amazon-cloudwatch-agent.json",
183183

validator/src/main/java/com/amazon/aoc/validators/CWMetricValidator.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
@Log4j2
4444
public class CWMetricValidator implements IValidator {
45-
private static int DEFAULT_MAX_RETRY_COUNT = 10;
45+
private static int DEFAULT_MAX_RETRY_COUNT = 80;
4646

4747
private MustacheHelper mustacheHelper = new MustacheHelper();
4848
private ICaller caller;
@@ -92,8 +92,8 @@ public void validate() throws Exception {
9292
RetryHelper.retry(
9393
maxRetryCount,
9494
() -> {
95-
// We will query both the Service and RemoteService dimensions to ensure we get all
96-
// metrics from all aggregations, specifically the [RemoteService] aggregation.
95+
// We will query metrics with specific [Service], [RemoteService], or [RemoteService, RemoteTarget] dimension
96+
// values to ensure we get all metrics from all aggregations, specifically the [RemoteService] aggregation.
9797
List<String> serviceNames =
9898
Lists.newArrayList(
9999
context.getServiceName(), context.getRemoteServiceDeploymentName());
@@ -106,26 +106,28 @@ public void validate() throws Exception {
106106

107107
List<Metric> actualMetricList = Lists.newArrayList();
108108

109-
// Add sets of dimesion filters to use for each query to CloudWatch
109+
// Add sets of dimesion filters to use for each query to CloudWatch.
110110
List<List<Pair<String, String>>> dimensionLists = Lists.newArrayList();
111-
// Query metrics for rolled up into the [serviceDimension] dimension
111+
// Query metrics that includes any of these <service> values.
112112
for (String serviceName : serviceNames) {
113113
dimensionLists.add(
114114
Arrays.asList(new Pair<>(CloudWatchService.SERVICE_DIMENSION, serviceName)));
115115
}
116-
// Query metrics for rolled up into the [remoteServiceDimension] dimension
116+
// Query metrics that includes any of these <remoteService> values.
117117
for (String remoteServiceName : remoteServiceNames) {
118118
dimensionLists.add(
119119
Arrays.asList(
120120
new Pair<>(CloudWatchService.REMOTE_SERVICE_DIMENSION, remoteServiceName)));
121121
}
122-
// Query metrics for rolled up into the [remoteServiceDimension, remoteTargetDemsion] dimensions
122+
// Query for metrics that includes both of these <remoteService, remoteTarget> values.
123+
// Querying just 'remoteService="AWS.SDK.S3"' would also work, but that will result in
124+
// returning too many canary metrics and may cause issues.
123125
dimensionLists.add(
124126
Arrays.asList(
125127
new Pair<>(CloudWatchService.REMOTE_SERVICE_DIMENSION, "AWS.SDK.S3"),
126128
new Pair<>(CloudWatchService.REMOTE_TARGET_DIMENSION, context.getRemoteTargetName())));
127129

128-
// Populate actualMetricList with metrics that pass through one of the dimension filters
130+
// Populate actualMetricList with metrics that pass through at least one of the dimension filters
129131
for (List<Pair<String, String>> dimensionList : dimensionLists) {
130132
addMetrics(dimensionList, expectedMetricList, actualMetricList);
131133
}

validator/src/test/java/com/amazon/aoc/validators/CWMetricValidatorTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ private Context initContext() {
162162
context.setServiceName(SERVICE_NAME);
163163
context.setRemoteServiceName(REMOTE_SERVICE_NAME);
164164
context.setRemoteServiceDeploymentName(REMOTE_SERVICE_DEPLOYMENT_NAME);
165+
context.setRemoteTargetName(REMOTE_TARGET_NAME);
165166
return context;
166167
}
167168

validator/src/test/test-resources/endToEnd_expectedMetrics.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@
9494
value: AWS.SDK.S3
9595
-
9696
name: RemoteTarget
97-
value: e2e-test-bucket-name
97+
value: remoteTargetName

validator/src/test/test-resources/endToEnd_remoteMetricsWithS3Target.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
value: AWS.SDK.S3
88
-
99
name: RemoteTarget
10-
value: e2e-test-bucket-name
10+
value: remoteTargetName

0 commit comments

Comments
 (0)