Skip to content

Commit e3a8c7d

Browse files
committed
test
1 parent 629faf5 commit e3a8c7d

File tree

2 files changed

+29
-89
lines changed

2 files changed

+29
-89
lines changed

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

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,11 @@
77
name: E2E Testing
88
on:
99
workflow_call:
10-
inputs:
11-
staging-instrumentation-name:
12-
required: true
13-
type: string
14-
adot-image-name:
15-
required: true
16-
type: string
1710

1811
permissions:
1912
id-token: write
2013
contents: read
2114

22-
concurrency:
23-
group: '${{ github.workflow }} @ ${{ inputs.aws-region }}'
24-
cancel-in-progress: false
25-
26-
2715
jobs:
2816
upload-main-build:
2917
runs-on: ubuntu-latest
@@ -124,4 +112,31 @@ jobs:
124112
with:
125113
node-version: 22
126114
staging-instrumentation-name: ${{ inputs.staging-instrumentation-name }}
127-
caller-workflow-name: 'main-build'
115+
caller-workflow-name: 'main-build'
116+
117+
validate-all-tests-are-accounted-for:
118+
runs-on: ubuntu-latest
119+
steps:
120+
- name: Install Ruby
121+
uses: ruby/[email protected]
122+
with:
123+
ruby-version: "3.4"
124+
- name: check TESTS_USED
125+
run: |
126+
git clone https://github.com/jj22ee/aws-application-signals-test-framework.git
127+
cd aws-application-signals-test-framework/.github/workflows/
128+
echo "TESTS_USED=$(ls | grep -E '^node-' | grep -v '\-perf-' | grep -E 'test\.ya?ml$' -c)" >> $GITHUB_ENV
129+
- name: check TESTS_AVAILABLE
130+
run: |
131+
git clone https://github.com/jj22ee/aws-otel-js-instrumentation.git
132+
cd aws-otel-js-instrumentation/.github/workflows/
133+
echo TESTS_AVAILABLE=$(ruby -ryaml -e 'puts YAML.load_file("application-signals-e2e-test.yml")["jobs"].values.map { |v| v["uses"] }.compact.uniq.count { |u| u.include?("aws-observability/aws-application-signals-test-framework/.github/workflows") }') >> $GITHUB_ENV
134+
- name: compare TESTS_USED and TESTS_AVAILABLE
135+
run: |
136+
echo ${{ env.TESTS_USED }}
137+
echo ${{ env.TESTS_AVAILABLE }}
138+
if [[ "${{ env.TESTS_USED }}" != "${{ env.TESTS_AVAILABLE }}" ]]; then
139+
exit 1
140+
fi
141+
142+

.github/workflows/main-build.yml

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -22,85 +22,10 @@ permissions:
2222
contents: read
2323

2424
jobs:
25-
build:
26-
runs-on: ubuntu-latest
27-
outputs:
28-
aws_default_region: ${{ steps.node_output.outputs.awsDefaultRegion}}
29-
node_image_tag: ${{ steps.node_output.outputs.node_image_tag}}
30-
staging_image: ${{ steps.node_output.outputs.stagingImage}}
31-
staging_registry: ${{ steps.node_output.outputs.stagingRegistry}}
32-
staging_repository: ${{ steps.node_output.outputs.stagingRepository}}
33-
staging_tarball_file: ${{ steps.staging_tarball_output.outputs.STAGING_TARBALL}}
34-
steps:
35-
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
36-
uses: actions/checkout@v4
37-
38-
- name: Get Node Distro Output
39-
id: node_output
40-
run: |
41-
pkg_version=$(jq -r '.version' ./package.json)
42-
echo "ADOT_NODE_VERSION=$pkg_version" >> $GITHUB_OUTPUT
43-
shortsha="$(git rev-parse --short HEAD)"
44-
echo "SHORT_SHA=$shortsha" >> $GITHUB_ENV
45-
node_distro_tag=$pkg_version-$shortsha
46-
echo "awsDefaultRegion=${{ env.AWS_DEFAULT_REGION }}" >> $GITHUB_OUTPUT
47-
echo "node_image_tag=$node_distro_tag" >> $GITHUB_OUTPUT
48-
echo "stagingRegistry=${{ env.STAGING_ECR_REGISTRY }}" >> $GITHUB_OUTPUT
49-
echo "stagingRepository=${{ env.STAGING_ECR_REPOSITORY }}" >> $GITHUB_OUTPUT
50-
echo "stagingImage=${{ env.STAGING_ECR_REGISTRY }}/${{ env.STAGING_ECR_REPOSITORY }}:$node_distro_tag" >> $GITHUB_OUTPUT
51-
52-
- name: Build and Push Tarball and Image Files
53-
uses: ./.github/actions/artifacts_build
54-
with:
55-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
56-
image_uri_with_tag: ${{ steps.node_output.outputs.stagingImage }}
57-
image_registry: ${{ env.STAGING_ECR_REGISTRY }}
58-
snapshot-ecr-role: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
59-
push_image: true
60-
load_image: false
61-
node_version: "20"
62-
package_name: aws-distro-opentelemetry-node-autoinstrumentation
63-
os: ubuntu-latest
64-
65-
- name: Output Tarball File Name
66-
id: staging_tarball_output
67-
run: |
68-
staging_tarball="aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ steps.node_output.outputs.ADOT_NODE_VERSION }}.tgz"
69-
echo "STAGING_TARBALL=$staging_tarball" >> $GITHUB_OUTPUT
70-
71-
- name: Upload Tarball to S3
72-
run: |
73-
aws s3 cp aws-distro-opentelemetry-node-autoinstrumentation/${{ steps.staging_tarball_output.outputs.STAGING_TARBALL }} s3://${{ env.STAGING_S3_BUCKET }}
74-
75-
- name: Upload Tarball to GitHub Actions
76-
uses: actions/upload-artifact@v4
77-
with:
78-
name: ${{ steps.staging_tarball_output.outputs.STAGING_TARBALL}}
79-
path: aws-distro-opentelemetry-node-autoinstrumentation/${{ steps.staging_tarball_output.outputs.STAGING_TARBALL}}
80-
81-
- name: Build and Publish Lambda Staging Layer
82-
uses: ./.github/actions/lambda_artifacts_build
83-
with:
84-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
85-
node_version: "20"
86-
layer_directory: lambda-layer
87-
staging_s3_bucket: ${{ env.STAGING_S3_BUCKET }}
88-
staging_tarball: ${{ steps.staging_tarball_output.outputs.STAGING_TARBALL}}
89-
# TODO - implement contract tests in NodeJS
90-
# - name: Set up and run contract tests with pytest
91-
# run: |
92-
# bash scripts/set-up-contract-tests.sh
93-
# pip install pytest
94-
# pytest contract-tests/tests
95-
9625
application-signals-e2e-test:
9726
name: "Application Signals E2E Test"
98-
needs: [ build ]
9927
uses: ./.github/workflows/application-signals-e2e-test.yml
10028
secrets: inherit
10129
permissions:
10230
id-token: write
103-
contents: read
104-
with:
105-
staging-instrumentation-name: ${{ needs.build.outputs.staging_tarball_file }}
106-
adot-image-name: ${{ needs.build.outputs.staging_registry }}/aws-observability/adot-autoinstrumentation-node-staging:${{ needs.build.outputs.node_image_tag }}
31+
contents: read

0 commit comments

Comments
 (0)