Skip to content

Commit cccac45

Browse files
author
Jeel Mehta
committed
refactor: standardize Python SigV4 test file naming convention
1 parent 66abb8e commit cccac45

16 files changed

+31
-28
lines changed

.github/workflows/python-ec2-adot-sigv4-test.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview
77
name: Python EC2 ADOT SigV4 (Stand-Alone ADOT) Use Case
88
on:
9+
push:
10+
branches:
11+
- Refactor_Python_files_folders
912
workflow_call:
1013
inputs:
1114
caller-workflow-name:
@@ -33,9 +36,9 @@ permissions:
3336
env:
3437
E2E_TEST_AWS_REGION: 'us-west-2'
3538
CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
36-
PYTHON_VERSION: ${{ inputs.python-version }}
37-
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }}
38-
ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name }}
39+
PYTHON_VERSION: ${{ inputs.python-version || '3.9' }}
40+
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture || 'x86_64' }}
41+
ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name || 'aws_opentelemetry_distro-0.9.0.dev0-061e4963-py3-none-any.whl' }}
3942
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
4043
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
4144
METRIC_NAMESPACE: ApplicationSignals
@@ -77,15 +80,15 @@ jobs:
7780

7881
- name: Set Get ADOT Wheel command environment variable
7982
run: |
80-
if [ "${{ github.event.repository.name }}" = "aws-otel-python-instrumentation" ]; then
83+
# if [ "${{ github.event.repository.name }}" = "aws-otel-python-instrumentation" ]; then
8184
# Reusing the adot-main-build-staging-jar bucket to store the python wheel file
82-
echo GET_ADOT_WHEEL_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/${{ env.ADOT_WHEEL_NAME }} ./${{ env.ADOT_WHEEL_NAME }} && sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
83-
else
84-
latest_release_version=$(curl -sL https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest | grep -oP '/releases/tag/v\K[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)
85-
echo "The latest version is $latest_release_version"
86-
echo GET_ADOT_WHEEL_COMMAND="wget -O ${{ env.ADOT_WHEEL_NAME }} https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest/download/aws_opentelemetry_distro-$latest_release_version-py3-none-any.whl \
87-
&& sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
88-
fi
85+
echo GET_ADOT_WHEEL_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/${{ env.ADOT_WHEEL_NAME }} ./${{ env.ADOT_WHEEL_NAME }} && sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
86+
# else
87+
# latest_release_version=$(curl -sL https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest | grep -oP '/releases/tag/v\K[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)
88+
# echo "The latest version is $latest_release_version"
89+
# echo GET_ADOT_WHEEL_COMMAND="wget -O ${{ env.ADOT_WHEEL_NAME }} https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest/download/aws_opentelemetry_distro-$latest_release_version-py3-none-any.whl \
90+
# && sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
91+
# fi
8992
9093
- name: Set up terraform
9194
uses: ./.github/workflows/actions/execute_and_retry
@@ -222,8 +225,8 @@ jobs:
222225
--rollup'
223226

224227
- name: Validate generated otlp logs
225-
id: log-validation-1
226-
run: ./gradlew validator:run --args='-c python/ec2/adot-aws-otlp/logs/log-validation.yml
228+
id: application-log-validation
229+
run: ./gradlew validator:run --args='-c python/ec2/adot-aws-otlp/logs/application-log-validation.yml
227230
--testing-id ${{ env.TESTING_ID }}
228231
--endpoint http://localhost:8000
229232
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001

validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -222,26 +222,26 @@ public enum PredefinedExpectedTemplate implements FileConfig {
222222

223223
/** Python EC2 ADOT SigV4 (Stand Alone ADOT) Test Case Validations */
224224
PYTHON_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG(
225-
"/expected-data-template/python/ec2/adot-aws-otlp/traces/outgoing-http-call-log.mustache"),
225+
"/expected-data-template/python/ec2/adot-aws-otlp/outgoing-http-call-log.mustache"),
226226
PYTHON_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC(
227-
"/expected-data-template/python/ec2/adot-aws-otlp/traces/outgoing-http-call-metric.mustache"),
227+
"/expected-data-template/python/ec2/adot-aws-otlp/outgoing-http-call-metric.mustache"),
228228
PYTHON_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_TRACE(
229-
"/expected-data-template/python/ec2/adot-aws-otlp/traces/outgoing-http-call-trace.mustache"),
229+
"/expected-data-template/python/ec2/adot-aws-otlp/outgoing-http-call-trace.mustache"),
230230

231-
PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG("/expected-data-template/python/ec2/adot-aws-otlp/traces/aws-sdk-call-log.mustache"),
232-
PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC("/expected-data-template/python/ec2/adot-aws-otlp/traces/aws-sdk-call-metric.mustache"),
233-
PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE("/expected-data-template/python/ec2/adot-aws-otlp/traces/aws-sdk-call-trace.mustache"),
231+
PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG("/expected-data-template/python/ec2/adot-aws-otlp/aws-sdk-call-log.mustache"),
232+
PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC("/expected-data-template/python/ec2/adot-aws-otlp/aws-sdk-call-metric.mustache"),
233+
PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE("/expected-data-template/python/ec2/adot-aws-otlp/aws-sdk-call-trace.mustache"),
234234

235-
PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG("/expected-data-template/python/ec2/adot-aws-otlp/traces/remote-service-log.mustache"),
236-
PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC("/expected-data-template/python/ec2/adot-aws-otlp/traces/remote-service-metric.mustache"),
237-
PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE("/expected-data-template/python/ec2/adot-aws-otlp/traces/remote-service-trace.mustache"),
235+
PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG("/expected-data-template/python/ec2/adot-aws-otlp/remote-service-log.mustache"),
236+
PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC("/expected-data-template/python/ec2/adot-aws-otlp/remote-service-metric.mustache"),
237+
PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE("/expected-data-template/python/ec2/adot-aws-otlp/remote-service-trace.mustache"),
238238

239-
PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_LOG("/expected-data-template/python/ec2/adot-aws-otlp/traces/client-call-log.mustache"),
240-
PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC("/expected-data-template/python/ec2/adot-aws-otlp/traces/client-call-metric.mustache"),
241-
PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE("/expected-data-template/python/ec2/adot-aws-otlp/traces/client-call-trace.mustache"),
239+
PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_LOG("/expected-data-template/python/ec2/adot-aws-otlp/client-call-log.mustache"),
240+
PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC("/expected-data-template/python/ec2/adot-aws-otlp/client-call-metric.mustache"),
241+
PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE("/expected-data-template/python/ec2/adot-aws-otlp/client-call-trace.mustache"),
242242

243243
/** Python EC2 ADOT SigV4 Log Exporter Test Case Validation */
244-
PYTHON_EC2_ADOT_OTLP_LOG("/expected-data-template/python/ec2/adot-aws-otlp/logs/log.mustache"),
244+
PYTHON_EC2_ADOT_OTLP_LOG("/expected-data-template/python/ec2/adot-aws-otlp/logs/application-log.mustache"),
245245

246246
/** Python K8S Test Case Validations */
247247
PYTHON_K8S_OUTGOING_HTTP_CALL_LOG("/expected-data-template/python/k8s/outgoing-http-call-log.mustache"),
@@ -326,7 +326,7 @@ public enum PredefinedExpectedTemplate implements FileConfig {
326326
DOTNET_EC2_ASG_CLIENT_CALL_METRIC("/expected-data-template/dotnet/ec2/asg/client-call-metric.mustache"),
327327
DOTNET_EC2_ASG_CLIENT_CALL_TRACE("/expected-data-template/dotnet/ec2/asg/client-call-trace.mustache"),
328328

329-
/** Python EC2 ADOT SigV4 (Stand Alone ADOT) Test Case Validations */
329+
/** DotNet EC2 ADOT SigV4 (Stand Alone ADOT) Test Case Validations */
330330
DOTNET_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG(
331331
"/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-log.mustache"),
332332
DOTNET_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC(
@@ -449,7 +449,7 @@ public enum PredefinedExpectedTemplate implements FileConfig {
449449
NODE_K8S_CLIENT_CALL_METRIC("/expected-data-template/node/k8s/client-call-metric.mustache"),
450450
NODE_K8S_CLIENT_CALL_TRACE("/expected-data-template/node/k8s/client-call-trace.mustache"),
451451

452-
/** Python EC2 ADOT SigV4 (Stand Alone ADOT) Test Case Validations */
452+
/** Node EC2 ADOT SigV4 (Stand Alone ADOT) Test Case Validations */
453453
NODE_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG(
454454
"/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-log.mustache"),
455455
NODE_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC(

0 commit comments

Comments
 (0)