Skip to content

Commit 726d25d

Browse files
authored
Trigger EKS E2E tests with Build Test Artifacts (#1937)
1 parent 5dd56c4 commit 726d25d

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

.github/workflows/build-test-artifacts.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,12 @@ on:
2323
description: "Run Test on the new container image"
2424
default: true
2525
type: boolean
26-
build-distributor:
27-
description: "Whether to build an SSM distributor"
28-
default: false
29-
type: boolean
3026
workflow_call:
3127
inputs:
3228
test-image-before-upload:
3329
description: "Run Test on the new container image"
3430
default: true
3531
type: boolean
36-
build-distributor:
37-
description: "Whether to build an SSM distributor"
38-
default: false
39-
type: boolean
4032

4133
concurrency:
4234
group: ${{ github.workflow }}-${{ github.ref_name }}
@@ -82,7 +74,6 @@ jobs:
8274

8375
BuildDistributor:
8476
needs: [BuildAndUpload, BuildAndUploadPackages, BuildDocker]
85-
if: ${{ github.event_name == 'push' || inputs.build-distributor }}
8677
uses: ./.github/workflows/test-build-distributor.yml
8778
secrets: inherit
8879
permissions:
@@ -139,9 +130,18 @@ jobs:
139130
- run: gh workflow run application-signals-e2e-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }}
140131
env:
141132
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133+
134+
StartEKSE2ETests:
135+
needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker, BuildDistributor ]
136+
if: ${{ github.event_name == 'push' || inputs.test-image-before-upload }}
137+
runs-on: ubuntu-latest
138+
steps:
139+
- run: gh workflow run e2e-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_sha=${{ github.sha }}
140+
env:
141+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142142

143143
StartWorkloadDiscoveryIntegrationTests:
144-
needs: [ BuildAndUploadPackages, BuildDocker ]
144+
needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker, BuildDistributor ]
145145
if: ${{ github.event_name == 'push' || inputs.test-image-before-upload }}
146146
runs-on: ubuntu-latest
147147
steps:

.github/workflows/e2e-test.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ env:
1414
OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator"
1515

1616
on:
17-
schedule:
18-
- cron: '0 17 * * 1'
1917
workflow_dispatch:
2018
inputs:
2119
region:
2220
required: false
2321
type: string
2422
description: 'AWS Region to run tests in'
2523
default: 'us-west-2'
24+
build_sha:
25+
description: 'The SHA of the build-test-artifacts workflow run'
26+
type: string
27+
required: false
2628
operator-branch:
2729
required: false
2830
type: string
@@ -60,6 +62,7 @@ jobs:
6062
echo "::set-output name=operator_sha::$latest_sha"
6163
6264
BuildAgent:
65+
if: ${{ !inputs.build_sha }}
6366
uses: ./.github/workflows/build-test-artifacts.yml
6467
concurrency:
6568
group: "Build-Test-Artifacts-${{github.ref_name}}"
@@ -86,6 +89,7 @@ jobs:
8689

8790
OutputEnvVariables:
8891
needs: [ BuildAgent, BuildOperator ]
92+
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
8993
name: 'OutputEnvVariables'
9094
runs-on: ubuntu-latest
9195
outputs:
@@ -127,6 +131,7 @@ jobs:
127131
128132
GenerateTestMatrix:
129133
needs: [BuildAgent, BuildOperator]
134+
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
130135
name: 'GenerateTestMatrix'
131136
runs-on: ubuntu-latest
132137
outputs:
@@ -154,6 +159,7 @@ jobs:
154159
155160
EKSE2EJVMTomcatTestHelm:
156161
needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ]
162+
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
157163
name: 'EKSE2EJVMTomcatTestHelm'
158164
uses: ./.github/workflows/eks-e2e-test.yml
159165
with:
@@ -164,7 +170,7 @@ jobs:
164170
test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }}
165171
test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
166172
cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }}
167-
cloudwatch_agent_tag: ${{ github.sha }}
173+
cloudwatch_agent_tag: ${{ inputs.build_sha || github.sha }}
168174
cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }}
169175
cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}
170176
region: ${{ inputs.region || 'us-west-2' }}
@@ -177,6 +183,7 @@ jobs:
177183

178184
EKSE2EJVMTomcatTestAddon:
179185
needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ]
186+
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
180187
name: 'EKSE2EJVMTomcatTestAddon'
181188
uses: ./.github/workflows/eks-e2e-test.yml
182189
with:
@@ -187,7 +194,7 @@ jobs:
187194
test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }}
188195
test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
189196
cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }}
190-
cloudwatch_agent_tag: ${{ github.sha }}
197+
cloudwatch_agent_tag: ${{ inputs.build_sha || github.sha }}
191198
cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }}
192199
cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}
193200
region: ${{ inputs.region || 'us-west-2' }}
@@ -200,6 +207,7 @@ jobs:
200207

201208
EKSE2EKafkaTestHelm:
202209
needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ]
210+
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
203211
name: 'EKSE2EKafkaTestHelm'
204212
uses: ./.github/workflows/eks-e2e-test.yml
205213
with:
@@ -210,7 +218,7 @@ jobs:
210218
test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }}
211219
test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
212220
cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }}
213-
cloudwatch_agent_tag: ${{ github.sha }}
221+
cloudwatch_agent_tag: ${{ inputs.build_sha || github.sha }}
214222
cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }}
215223
cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}
216224
region: ${{ inputs.region || 'us-west-2' }}
@@ -223,6 +231,7 @@ jobs:
223231

224232
EKSE2EKafkaTestAddon:
225233
needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ]
234+
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
226235
name: 'EKSE2EKafkaTestAddon'
227236
uses: ./.github/workflows/eks-e2e-test.yml
228237
with:
@@ -233,7 +242,7 @@ jobs:
233242
test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }}
234243
test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
235244
cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }}
236-
cloudwatch_agent_tag: ${{ github.sha }}
245+
cloudwatch_agent_tag: ${{ inputs.build_sha || github.sha }}
237246
cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }}
238247
cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}
239248
region: ${{ inputs.region || 'us-west-2' }}
@@ -246,6 +255,7 @@ jobs:
246255

247256
EKSE2EJMXContainerInsightsTestHelm:
248257
needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ]
258+
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
249259
name: 'EKSE2EJMXContainerInsightsTestHelm'
250260
uses: ./.github/workflows/eks-e2e-test.yml
251261
with:
@@ -256,7 +266,7 @@ jobs:
256266
test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }}
257267
test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
258268
cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }}
259-
cloudwatch_agent_tag: ${{ github.sha }}
269+
cloudwatch_agent_tag: ${{ inputs.build_sha || github.sha }}
260270
cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }}
261271
cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}
262272
region: ${{ inputs.region || 'us-west-2' }}
@@ -269,6 +279,7 @@ jobs:
269279

270280
EKSE2EJMXContainerInsightsTestAddon:
271281
needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ]
282+
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
272283
name: 'EKSE2EJMXContainerInsightsTestAddon'
273284
uses: ./.github/workflows/eks-e2e-test.yml
274285
with:
@@ -279,7 +290,7 @@ jobs:
279290
test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }}
280291
test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
281292
cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }}
282-
cloudwatch_agent_tag: ${{ github.sha }}
293+
cloudwatch_agent_tag: ${{ inputs.build_sha || github.sha }}
283294
cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }}
284295
cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}
285296
region: ${{ inputs.region || 'us-west-2' }}

0 commit comments

Comments
 (0)