-
Notifications
You must be signed in to change notification settings - Fork 1.7k
188 lines (175 loc) · 8.11 KB
/
automation-ondemand-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Run Automation On Demand Tests
on:
workflow_dispatch:
inputs:
chainlinkVersionUpdate:
description: Chainlink image version to upgrade to (Leave empty to build from head/ref)
required: false
type: string
chainlinkImageUpdate:
description: Chainlink image repo to upgrade to
options:
- QA_ECR
- public.ecr.aws/chainlink/chainlink
type: choice
chainlinkVersion:
description: Chainlink image version to use initially for upgrade test
default: latest
required: true
type: string
chainlinkImage:
description: Chainlink image repo to use initially for upgrade test
required: true
options:
- public.ecr.aws/chainlink/chainlink
- QA_ECR
type: choice
enableChaos:
description: Check to enable chaos tests
type: boolean
default: false
required: true
enableReorg:
description: Check to enable reorg tests
type: boolean
default: false
required: true
with_existing_remote_runner_version:
description: 'Tag of the existing remote runner version to use (Leave empty to build from head/ref)'
required: false
type: string
team:
description: Team to run the tests for (e.g. BIX, CCIP)
required: true
type: string
jobs:
# Set tests to run based on the workflow inputs
set-tests-to-run:
name: Set tests to run
runs-on: ubuntu-latest
outputs:
test_list: ${{ steps.set-tests.outputs.test_list }}
require_chainlink_image_versions_in_qa_ecr: ${{ steps.determine-chainlink-image-check.outputs.require_chainlink_image_versions_in_qa_ecr }}
steps:
- name: Determine build to use
id: determine-build
shell: bash
run: |
if [[ "${{ inputs.chainlinkImage }}" == "QA_ECR" ]]; then
echo "image='{{ env.QA_CHAINLINK_IMAGE }}'" >> $GITHUB_ENV
else
echo "image=${{ inputs.chainlinkImage }}" >> $GITHUB_ENV
fi
if [[ "${{ inputs.chainlinkImageUpdate }}" == "QA_ECR" ]]; then
echo "upgrade_image='{{ env.QA_CHAINLINK_IMAGE }}'" >> $GITHUB_ENV
else
echo "upgrade_image=${{ inputs.chainlinkImageUpdate }}" >> $GITHUB_ENV
fi
if [[ -z "${{ inputs.chainlinkVersion }}" ]] && [[ "${{ inputs.chainlinkImage }}" == "QA_ECR" ]]; then
echo "version=${{ github.sha }}" >> $GITHUB_ENV
else
echo "version=${{ inputs.chainlinkVersion }}" >> $GITHUB_ENV
fi
if [[ -z "${{ inputs.chainlinkVersionUpdate }}" ]] && [[ "${{ inputs.chainlinkImageUpdate }}" == "QA_ECR" ]]; then
echo "upgrade_version=${{ github.sha }}" >> $GITHUB_ENV
else
echo "upgrade_version=${{ inputs.chainlinkVersionUpdate }}" >> $GITHUB_ENV
fi
- name: Check if chainlink image check required
id: determine-chainlink-image-check
shell: bash
run: |
chainlink_image_versions=""
if [ "${{ github.event.inputs.chainlinkImage }}" = "QA_ECR" ]; then
chainlink_image_versions+="${{ env.version }},"
fi
if [ "${{ github.event.inputs.chainlinkImageUpdate }}" = "QA_ECR" ]; then
chainlink_image_versions+="${{ env.upgrade_version }}"
fi
echo "require_chainlink_image_versions_in_qa_ecr=$chainlink_image_versions" >> $GITHUB_OUTPUT
- name: Set tests to run
id: set-tests
run: |
# Always run upgrade tests
cat > test_list.yaml <<EOF
- id: smoke/automation_upgrade_test.go:^TestAutomationNodeUpgrade/registry_2_0
test_env_vars:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.image }}
E2E_TEST_CHAINLINK_VERSION: ${{ env.version }}
E2E_TEST_CHAINLINK_UPGRADE_IMAGE: ${{ env.upgrade_image }}
E2E_TEST_CHAINLINK_UPGRADE_VERSION: ${{ env.upgrade_version }}
- id: smoke/automation_upgrade_test.go:^TestAutomationNodeUpgrade/registry_2_1
test_env_vars:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.image }}
E2E_TEST_CHAINLINK_VERSION: ${{ env.version }}
E2E_TEST_CHAINLINK_UPGRADE_IMAGE: ${{ env.upgrade_image }}
E2E_TEST_CHAINLINK_UPGRADE_VERSION: ${{ env.upgrade_version }}
- id: smoke/automation_upgrade_test.go:^TestAutomationNodeUpgrade/registry_2_2
test_env_vars:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.image }}
E2E_TEST_CHAINLINK_VERSION: ${{ env.version }}
E2E_TEST_CHAINLINK_UPGRADE_IMAGE: ${{ env.upgrade_image }}
E2E_TEST_CHAINLINK_UPGRADE_VERSION: ${{ env.upgrade_version }}
EOF
# Run reorg tests if enabled
if [[ "${{ github.event.inputs.enableReorg }}" == 'true' ]]; then
cat >> test_list.yaml <<EOF
- id: reorg/automation_reorg_test.go^TestAutomationReorg/registry_2_0
test_env_vars:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.image }}
E2E_TEST_CHAINLINK_VERSION: ${{ env.version }}
- id: reorg/automation_reorg_test.go^TestAutomationReorg/registry_2_1
test_env_vars:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.image }}
E2E_TEST_CHAINLINK_VERSION: ${{ env.version }}
- id: reorg/automation_reorg_test.go^TestAutomationReorg/registry_2_2
test_env_vars:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.image }}
E2E_TEST_CHAINLINK_VERSION: ${{ env.version }}
- id: reorg/automation_reorg_test.go^TestAutomationReorg/registry_2_3
test_env_vars:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.image }}
E2E_TEST_CHAINLINK_VERSION: ${{ env.version }}
EOF
fi
# Run chaos tests if enabled
if [[ "${{ github.event.inputs.enableChaos }}" == 'true' ]]; then
cat >> test_list.yaml <<EOF
- id: chaos/automation_chaos_test.go
test_env_vars:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.image }}
E2E_TEST_CHAINLINK_VERSION: ${{ env.version }}
EOF
fi
echo "test_list=$(cat test_list.yaml | base64 -w 0)" >> $GITHUB_OUTPUT
call-run-e2e-tests-workflow:
name: Run E2E Tests
needs: set-tests-to-run
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@0d4a2b2b009c87b5c366d0b97f7a8d7de2f60760
with:
test_path: .github/e2e-tests.yml
test_list: ${{ needs.set-tests-to-run.outputs.test_list }}
require_chainlink_image_versions_in_qa_ecr: ${{ needs.set-tests-to-run.outputs.require_chainlink_image_versions_in_qa_ecr }}
with_existing_remote_runner_version: ${{ github.event.inputs.with_existing_remote_runner_version }}
test_log_upload_on_failure: true
test_log_upload_retention_days: 7
team: ${{ inputs.team }}
secrets:
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }}
QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }}
GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }}
LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }}
LOKI_URL: ${{ secrets.LOKI_URL }}
LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }}
AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }}