Skip to content

Commit 9f03df0

Browse files
committed
Add Test Coverage to Enablement E2E Test
1 parent 831b76b commit 9f03df0

File tree

2 files changed

+236
-8
lines changed

2 files changed

+236
-8
lines changed

.github/workflows/application-signals-e2e-test.yml

Lines changed: 139 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,48 +41,179 @@ jobs:
4141
- name: Upload main-build adot.whl to s3
4242
run: aws s3 cp ${{ inputs.staging-wheel-name }} s3://adot-main-build-staging-jar/${{ inputs.staging-wheel-name }}
4343

44-
python-ec2-default-e2e-test:
44+
#
45+
# PACKAGED DISTRIBUTION LANGUAGE VERSION COVERAGE
46+
# DEFAULT SETTING: {Python Version}, EC2, AMD64, AL2
47+
#
48+
49+
default-v8-amd64:
4550
needs: [ upload-main-build ]
4651
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-default-test.yml@main
4752
secrets: inherit
4853
with:
4954
aws-region: us-east-1
50-
staging-wheel-name: aws_opentelemetry_distro-0.2.0.dev0-07ca0f26-py3-none-any.whl
5155
caller-workflow-name: 'main-build'
56+
python-version: '3.8'
57+
cpu-architecture: 'x86_64'
58+
staging-wheel-name: ${{ inputs.staging-wheel-name }}
5259

53-
python-ec2-asg-e2e-test:
60+
default-v11-amd64:
5461
needs: [ upload-main-build ]
55-
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-asg-test.yml@main
62+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-default-test.yml@main
63+
secrets: inherit
64+
with:
65+
aws-region: us-east-1
66+
caller-workflow-name: 'main-build'
67+
python-version: '3.9'
68+
cpu-architecture: 'x86_64'
69+
staging-wheel-name: ${{ inputs.staging-wheel-name }}
70+
71+
default-v17-amd64:
72+
needs: [ upload-main-build ]
73+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-default-test.yml@main
5674
secrets: inherit
5775
with:
5876
aws-region: us-east-1
59-
staging-wheel-name: aws_opentelemetry_distro-0.2.0.dev0-07ca0f26-py3-none-any.whl
6077
caller-workflow-name: 'main-build'
78+
python-version: '3.10'
79+
cpu-architecture: 'x86_64'
80+
staging-wheel-name: ${{ inputs.staging-wheel-name }}
6181

62-
python-eks-e2e-test:
82+
default-v21-amd64:
83+
needs: [ upload-main-build ]
84+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-default-test.yml@main
85+
secrets: inherit
86+
with:
87+
aws-region: us-east-1
88+
caller-workflow-name: 'main-build'
89+
python-version: '3.11'
90+
cpu-architecture: 'x86_64'
91+
staging-wheel-name: ${{ inputs.staging-wheel-name }}
92+
93+
default-v22-amd64:
94+
needs: [ upload-main-build ]
95+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-default-test.yml@main
96+
secrets: inherit
97+
with:
98+
aws-region: us-east-1
99+
caller-workflow-name: 'main-build'
100+
python-version: '3.12'
101+
cpu-architecture: 'x86_64'
102+
staging-wheel-name: ${{ inputs.staging-wheel-name }}
103+
104+
#
105+
# DOCKER DISTRIBUTION LANGUAGE VERSION COVERAGE
106+
# DEFAULT SETTING: {Python Version}, EKS, AMD64, AL2
107+
#
108+
109+
eks-v3-8-amd64:
110+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-eks-test.yml@main
111+
secrets: inherit
112+
with:
113+
aws-region: us-east-1
114+
test-cluster-name: 'e2e-python-adot-test'
115+
adot-image-name: ${{ inputs.adot-image-name }}
116+
caller-workflow-name: 'main-build'
117+
python-version: '3.8'
118+
119+
eks-v3-9-amd64:
120+
needs: eks-v3-8-amd64
63121
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-eks-test.yml@main
64122
secrets: inherit
65123
with:
66124
aws-region: us-east-1
67125
test-cluster-name: 'e2e-python-adot-test'
68126
adot-image-name: ${{ inputs.adot-image-name }}
69127
caller-workflow-name: 'main-build'
128+
python-version: '3.9'
70129

71-
python-k8s-e2e-test:
130+
eks-v3-10-amd64:
131+
needs: eks-v3-9-amd64
132+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-eks-test.yml@main
133+
secrets: inherit
134+
with:
135+
aws-region: us-east-1
136+
test-cluster-name: 'e2e-python-adot-test'
137+
adot-image-name: ${{ inputs.adot-image-name }}
138+
caller-workflow-name: 'main-build'
139+
python-version: '3.10'
140+
141+
eks-v3-11-amd64:
142+
needs: eks-v3-10-amd64
143+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-eks-test.yml@main
144+
secrets: inherit
145+
with:
146+
aws-region: us-east-1
147+
test-cluster-name: 'e2e-python-adot-test'
148+
adot-image-name: ${{ inputs.adot-image-name }}
149+
caller-workflow-name: 'main-build'
150+
python-version: '3.11'
151+
152+
eks-v3-12-amd64:
153+
needs: eks-v3-11-amd64
154+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-eks-test.yml@main
155+
secrets: inherit
156+
with:
157+
aws-region: us-east-1
158+
test-cluster-name: 'e2e-python-adot-test'
159+
adot-image-name: ${{ inputs.adot-image-name }}
160+
caller-workflow-name: 'main-build'
161+
python-version: '3.12'
162+
163+
#
164+
# PACKAGED DISTRIBUTION PLATFORM COVERAGE
165+
# DEFAULT SETTING: Python 3.9, {Platform}, AMD64, AL2
166+
#
167+
168+
asg-v11-amd64:
169+
needs: [ upload-main-build ]
170+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-asg-test.yml@main
171+
secrets: inherit
172+
with:
173+
aws-region: us-east-1
174+
caller-workflow-name: 'main-build'
175+
python-version: '3.9'
176+
staging-wheel-name: ${{ inputs.staging-wheel-name }}
177+
178+
#
179+
# DOCKER DISTRIBUTION PLATFORM COVERAGE
180+
# DEFAULT SETTING: Python 3.10, {Platform}, AMD64, AL2
181+
#
182+
183+
k8s-v11-amd64:
72184
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-k8s-test.yml@main
73185
secrets: inherit
74186
with:
75187
aws-region: us-east-1
76188
adot-image-name: ${{ inputs.adot-image-name }}
77189
caller-workflow-name: 'main-build'
190+
python-version: '3.10'
78191

79-
python-ecs-e2e-test:
192+
193+
ecs-v11-amd64:
80194
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ecs-test.yml@main
81195
secrets: inherit
82196
with:
83197
aws-region: us-east-1
84198
adot-image-name: ${{ inputs.adot-image-name }}
85199
caller-workflow-name: 'main-build'
200+
python-version: '3.10'
201+
202+
#
203+
# CPU ARCHITECTURE COVERAGE
204+
# DEFAULT SETTING: Python 3.9, EC2, {CPU Architecture}, AL2
205+
#
206+
207+
default-v11-arm64:
208+
needs: [ upload-main-build ]
209+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-default-test.yml@main
210+
secrets: inherit
211+
with:
212+
aws-region: us-east-1
213+
caller-workflow-name: 'main-build'
214+
python-version: '3.9'
215+
cpu-architecture: 'arm64'
216+
staging-wheel-name: ${{ inputs.staging-wheel-name }}
86217

87218

88219

.github/workflows/test-2.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# This workflow build the aws-opentelemetry-distro wheel file, upload to staging S3 bucket, and build project docker image then push to staging ECR
2+
name: Python Instrumentation Main Build
3+
on:
4+
push:
5+
6+
env:
7+
AWS_DEFAULT_REGION: us-east-1
8+
STAGING_ECR_REGISTRY: 637423224110.dkr.ecr.us-east-1.amazonaws.com
9+
STAGING_ECR_REPOSITORY: aws-observability/adot-autoinstrumentation-python-staging
10+
STAGING_S3_BUCKET: ${{ secrets.STAGING_BUCKET_NAME }}
11+
12+
concurrency:
13+
group: python-instrumentation-main-build
14+
cancel-in-progress: false
15+
16+
permissions:
17+
id-token: write
18+
contents: read
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
aws_default_region: ${{ steps.python_output.outputs.awsDefaultRegion}}
25+
python_image_tag: ${{ steps.python_output.outputs.python_image_tag}}
26+
staging_image: ${{ steps.python_output.outputs.stagingImage}}
27+
staging_registry: ${{ steps.python_output.outputs.stagingRegistry}}
28+
staging_repository: ${{ steps.python_output.outputs.stagingRepository}}
29+
staging_wheel_file: ${{ steps.staging_wheel_output.outputs.STAGING_WHEEL}}
30+
steps:
31+
- name: Checkout Repo @ SHA - ${{ github.sha }}
32+
uses: actions/checkout@v4
33+
34+
- name: Get Python Distro Output
35+
id: python_output
36+
run: |
37+
pkg_version=$(grep '__version__' ./aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py | awk -F '"' '{print $2}')
38+
echo "ADOT_PYTHON_VERSION=$pkg_version" >> $GITHUB_OUTPUT
39+
shortsha="$(git rev-parse --short HEAD)"
40+
echo "SHORT_SHA=$shortsha" >> $GITHUB_ENV
41+
python_distro_tag=$pkg_version-$shortsha
42+
echo "awsDefaultRegion=${{ env.AWS_DEFAULT_REGION }}" >> $GITHUB_OUTPUT
43+
echo "python_image_tag=$python_distro_tag" >> $GITHUB_OUTPUT
44+
echo "stagingRegistry=${{ env.STAGING_ECR_REGISTRY }}" >> $GITHUB_OUTPUT
45+
echo "stagingRepository=${{ env.STAGING_ECR_REPOSITORY }}" >> $GITHUB_OUTPUT
46+
echo "stagingImage=${{ env.STAGING_ECR_REGISTRY }}/${{ env.STAGING_ECR_REPOSITORY }}:$python_distro_tag" >> $GITHUB_OUTPUT
47+
48+
- name: Build and Push Wheel and Image Files
49+
uses: ./.github/actions/artifacts_build
50+
with:
51+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
52+
image_uri_with_tag: ${{ steps.python_output.outputs.stagingImage}}
53+
image_registry: ${{ env.STAGING_ECR_REGISTRY }}
54+
snapshot-ecr-role: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
55+
push_image: true
56+
load_image: false
57+
python_version: "3.10"
58+
package_name: aws-opentelemetry-distro
59+
os: ubuntu-latest
60+
61+
# workaround: prefixing the short-sha with a 0 to create a valid
62+
# wheel file name as per https://peps.python.org/pep-0427/#file-name-convention
63+
- name: Output Wheel File Name
64+
id: staging_wheel_output
65+
run: |
66+
staging_wheel="aws_opentelemetry_distro-${{ steps.python_output.outputs.ADOT_PYTHON_VERSION}}-0${{ env.SHORT_SHA }}-py3-none-any.whl"
67+
echo "STAGING_WHEEL=$staging_wheel" >> $GITHUB_OUTPUT
68+
cd ./dist
69+
cp aws_opentelemetry_distro-${{ steps.python_output.outputs.ADOT_PYTHON_VERSION}}-py3-none-any.whl $staging_wheel
70+
71+
- name: Upload wheel to S3
72+
run: |
73+
aws s3 cp dist/${{ steps.staging_wheel_output.outputs.STAGING_WHEEL}} s3://${{ env.STAGING_S3_BUCKET }}
74+
75+
- name: Upload Wheel to GitHub Actions
76+
uses: actions/upload-artifact@v3
77+
with:
78+
name: ${{ steps.staging_wheel_output.outputs.STAGING_WHEEL}}
79+
path: dist/${{ steps.staging_wheel_output.outputs.STAGING_WHEEL}}
80+
81+
- name: Set up and run contract tests with pytest
82+
run: |
83+
bash scripts/set-up-contract-tests.sh
84+
pip install pytest
85+
pytest contract-tests/tests
86+
87+
application-signals-e2e-test:
88+
name: "Application Signals E2E Test"
89+
needs: [ build ]
90+
uses: ./.github/workflows/application-signals-e2e-test.yml
91+
secrets: inherit
92+
permissions:
93+
id-token: write
94+
contents: read
95+
with:
96+
staging-wheel-name: ${{ needs.build.outputs.staging_wheel_file }}
97+
adot-image-name: ${{ needs.build.outputs.staging_registry }}/aws-observability/adot-autoinstrumentation-python-staging:${{ needs.build.outputs.python_image_tag }}

0 commit comments

Comments
 (0)