@@ -17,271 +17,64 @@ defaults:
17
17
shell : bash -leo pipefail {0}
18
18
19
19
jobs :
20
- setup-repositories :
21
- name : Set up Integration Tests
20
+ integration-tests :
21
+ name : Run Integration Tests
22
22
# if triggered by pull_request, only run on non-fork PRs (secrets access needed)
23
23
# Nevertheless, this check is always run in the merge queue.
24
24
if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
25
25
runs-on : ubuntu-latest
26
- outputs :
27
- scenario_ids : ${{ steps.setup_repositories.outputs.scenario_ids }}
28
26
steps :
27
+ - name : Set up Docker Buildx
28
+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
29
+
29
30
- name : Checkout
30
31
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31
32
with :
32
33
path : cf-scripts
33
-
34
- - name : Set up Docker Buildx
35
- uses : docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
34
+ submodules : ' true'
36
35
37
36
- name : Build Docker Image
38
- uses : docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11 .0
37
+ uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15 .0
39
38
with :
40
39
context : cf-scripts
41
40
push : false
42
41
load : true
43
42
tags : conda-forge-tick:test
44
43
cache-from : type=gha
45
44
cache-to : type=gha,mode=max
46
- outputs : type=docker,dest=/tmp/image.tar
47
45
48
- - name : Upload Docker Image
49
- uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
46
+ - name : Setup micromamba
47
+ uses : mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2.0.4
50
48
with :
51
- name : conda-forge-tick
52
- path : /tmp/image.tar
53
-
54
- - name : setup-micromamba
55
- uses : mamba-org/setup-micromamba@4b9113af4fba0e9e1124b252dd6497a419e7396d # v1.11.0
56
- with :
57
- environment-file : cf-scripts/conda-lock.yml
49
+ environment-file : conda-lock.yml
58
50
environment-name : cf-scripts
59
- condarc-file : cf-scripts/ autotick-bot/condarc
51
+ condarc-file : autotick-bot/condarc
60
52
61
53
- name : Run pip install
62
54
working-directory : cf-scripts
63
55
run : |
64
56
pip install --no-deps --no-build-isolation -e .
65
57
66
- - name : Set up Integration Test Repositories
67
- id : setup_repositories
58
+ - name : Run mitmproxy certificate setup wizard
68
59
working-directory : cf-scripts
69
- # note: this writes `scenario_ids` to GITHUB_OUTPUT
70
- run : python -m tests_integration.setup_repositories
71
- env :
72
- TEST_SETUP_TOKEN : ${{ secrets.GH_TOKEN_STAGING_BOT_USER }}
73
-
74
- run-test-scenario :
75
- name : Run Scenarios
76
- # if triggered by pull_request, only run on non-fork PRs (secrets access needed)
77
- # Nevertheless, this check is always run in the merge queue.
78
- if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
79
- runs-on : ubuntu-latest
80
- needs : setup-repositories
81
- strategy :
82
- matrix :
83
- scenario_id : ${{ fromJson(needs.setup-repositories.outputs.scenario_ids) }}
84
- max-parallel : 1
85
- fail-fast : false
86
- steps :
87
- - name : Checkout
88
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
89
- with :
90
- path : cf-scripts
91
- submodules : ' true'
92
-
93
- - name : Download Docker Image
94
- uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
95
- with :
96
- name : conda-forge-tick
97
- path : /tmp
98
-
99
- - name : setup-micromamba
100
- uses : mamba-org/setup-micromamba@4b9113af4fba0e9e1124b252dd6497a419e7396d # v1.11.0
101
- with :
102
- environment-file : cf-scripts/conda-lock.yml
103
- environment-name : cf-scripts
104
- condarc-file : cf-scripts/autotick-bot/condarc
105
-
106
- - name : Install Bot Code (no graph clone)
107
- # this is the first time, so we clean disk space, but don't clone the graph
108
- run : source cf-scripts/autotick-bot/install_bot_code.sh --no-pull-container --no-clone-graph
109
-
110
- - name : Load Docker Image
111
- run : |
112
- docker load --input /tmp/image.tar
113
- docker image ls -a
114
-
115
- - name : Prepare Scenario
116
- working-directory : cf-scripts
117
- run : python -m tests_integration.step_prepare # this creates the cf-graph repository
118
- env :
119
- SCENARIO_ID : ${{ matrix.scenario_id }}
120
- TEST_SETUP_TOKEN : ${{ secrets.GH_TOKEN_STAGING_BOT_USER }}
121
-
122
- - name : Install Bot Code
123
60
run : |
124
- source cf-scripts/autotick-bot/install_bot_code.sh --no-pull-container --no-clean-disk-space
125
-
126
- - name : Start HTTP Proxy
127
- working-directory : cf-scripts
128
- run : |
129
- ./tests_integration/mock_proxy_start.sh &
130
- sleep 10
131
- # Install CA Certificate
132
- sudo wget -e use_proxy=yes -e http_proxy=127.0.0.1:8080 -O /usr/local/share/ca-certificates/mitmproxy.crt \
133
- http://mitm.it/cert/pem
61
+ # place a script in the mitmproxy directory that will be run by the setup wizard
62
+ # to trust the mitmproxy certificate
63
+ cat <<EOF "${MITMPROXY_WIZARD_HEADLESS_TRUST_SCRIPT}"
64
+ #!/usr/bin/env bash
65
+ set -euo pipefail
66
+ sudo cp "$1" /usr/local/share/ca-certificates/mitmproxy.crt
134
67
sudo update-ca-certificates
135
- env :
136
- SCENARIO_ID : ${{ matrix.scenario_id }}
137
- PYTHONPATH : ${{ github.workspace }}/cf-scripts
68
+ EOF
138
69
139
- - name : " [Test] Gather all Feedstocks"
140
- working-directory : cf-graph
141
- run : |
142
- # don't use proxy for git CLI operations (applies to all further steps)
143
- git config --global http."https://github.com".proxy ""
144
- conda-forge-tick --debug gather-all-feedstocks
145
-
146
- - name : " [Test] Deploy to GitHub"
147
- working-directory : cf-graph
148
- run : conda-forge-tick --debug deploy-to-github
149
-
150
- - name : Reinstall Bot Code
151
- run : |
152
- source cf-scripts/tests_integration/clear_runner.sh
153
- source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container
154
-
155
- - name : " [Test] Make Graph (Nodes and Edges)"
156
- working-directory : cf-graph
157
- run : conda-forge-tick --debug make-graph --update-nodes-and-edges
158
-
159
- - name : " [Test] Deploy to GitHub"
160
- working-directory : cf-graph
161
- run : conda-forge-tick --debug deploy-to-github
162
-
163
- - name : Reinstall Bot Code
164
- run : |
165
- source cf-scripts/tests_integration/clear_runner.sh
166
- source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container
167
-
168
- - name : " [Test] Make Graph (Node Attributes)"
169
- working-directory : cf-graph
170
- run : conda-forge-tick --debug make-graph
171
- env :
172
- CF_TICK_FRAC_MAKE_GRAPH : " 1.0"
173
-
174
- - name : " [Test] Deploy to GitHub"
175
- working-directory : cf-graph
176
- run : conda-forge-tick --debug deploy-to-github
177
-
178
- - name : Reinstall Bot Code
179
- run : |
180
- source cf-scripts/tests_integration/clear_runner.sh
181
- source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container
182
-
183
- - name : " [Test] update-upstream-versions"
184
- working-directory : cf-graph
185
- run : conda-forge-tick --debug update-upstream-versions
186
- env :
187
- http_proxy : http://127.0.0.1:8080
188
- https_proxy : http://127.0.0.1:8080
189
- SSL_CERT_FILE : /etc/ssl/certs/ca-certificates.crt
190
- REQUESTS_CA_BUNDLE : /etc/ssl/certs/ca-certificates.crt
191
- CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE : true
192
- CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER : http://172.17.0.1:8080
193
-
194
- - name : " [Test] Deploy to GitHub"
195
- working-directory : cf-graph
196
- run : conda-forge-tick --debug deploy-to-github
197
-
198
- - name : Reinstall Bot Code
199
- run : |
200
- source cf-scripts/tests_integration/clear_runner.sh
201
- source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container
202
-
203
- - name : " [Test] make-migrators (1/2)"
204
- working-directory : cf-graph
205
- run : conda-forge-tick --debug make-migrators
206
- env :
207
- http_proxy : http://127.0.0.1:8080
208
- https_proxy : http://127.0.0.1:8080
209
- SSL_CERT_FILE : /etc/ssl/certs/ca-certificates.crt
210
- REQUESTS_CA_BUNDLE : /etc/ssl/certs/ca-certificates.crt
211
- CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE : true
212
- CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER : http://172.17.0.1:8080
213
-
214
- - name : " [Test] Deploy to GitHub"
215
- working-directory : cf-graph
216
- run : conda-forge-tick --debug deploy-to-github
217
-
218
- - name : Reinstall Bot Code
219
- run : |
220
- source cf-scripts/tests_integration/clear_runner.sh
221
- source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container
222
-
223
- - name : " [Test] auto-tick (1/2)"
224
- working-directory : cf-graph
225
- run : conda-forge-tick --debug auto-tick
226
- env :
227
- http_proxy : http://127.0.0.1:8080
228
- https_proxy : http://127.0.0.1:8080
229
- SSL_CERT_FILE : /etc/ssl/certs/ca-certificates.crt
230
- REQUESTS_CA_BUNDLE : /etc/ssl/certs/ca-certificates.crt
231
- CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE : true
232
- CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER : http://172.17.0.1:8080
233
-
234
- - name : " [Test] Deploy to GitHub"
235
- working-directory : cf-graph
236
- run : conda-forge-tick --debug deploy-to-github
237
-
238
- - name : Reinstall Bot Code
239
- run : |
240
- source cf-scripts/tests_integration/clear_runner.sh
241
- source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container
242
-
243
- - name : " [Test] make-migrators (2/2)"
244
- working-directory : cf-graph
245
- run : conda-forge-tick --debug make-migrators
70
+ ./tests_integration/mitmproxy_setup_wizard.sh
246
71
env :
247
- http_proxy : http://127.0.0.1:8080
248
- https_proxy : http://127.0.0.1:8080
249
- SSL_CERT_FILE : /etc/ssl/certs/ca-certificates.crt
250
- REQUESTS_CA_BUNDLE : /etc/ssl/certs/ca-certificates.crt
251
- CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE : true
252
- CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER : http://172.17.0.1:8080
253
-
254
- - name : " [Test] Deploy to GitHub"
255
- working-directory : cf-graph
256
- run : conda-forge-tick --debug deploy-to-github
257
-
258
- - name : Reinstall Bot Code
259
- run : |
260
- source cf-scripts/tests_integration/clear_runner.sh
261
- source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container
72
+ MITMPROXY_WIZARD_HEADLESS : true
73
+ MITMPROXY_WIZARD_HEADLESS_TRUST_SCRIPT : ./tests_integration/.mitmproxy/mitmproxy_trust_script.sh
262
74
263
- - name : " [Test] auto-tick (2/2)"
264
- working-directory : cf-graph
265
- run : conda-forge-tick --debug auto-tick
266
- env :
267
- http_proxy : http://127.0.0.1:8080
268
- https_proxy : http://127.0.0.1:8080
269
- SSL_CERT_FILE : /etc/ssl/certs/ca-certificates.crt
270
- REQUESTS_CA_BUNDLE : /etc/ssl/certs/ca-certificates.crt
271
- CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE : true
272
- CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER : http://172.17.0.1:8080
273
-
274
- - name : " [Test] Deploy to GitHub"
275
- working-directory : cf-graph
276
- run : conda-forge-tick --debug deploy-to-github
277
-
278
- - name : Validate Scenario
75
+ - name : Run Integration Tests with pytest
279
76
working-directory : cf-scripts
280
- run : python -m tests_integration.step_validate
77
+ run : pytest -s -v tests_integration
281
78
env :
282
- SCENARIO_ID : ${{ matrix.scenario_id }}
79
+ BOT_TOKEN : ${{ secrets.GH_TOKEN_STAGING_BOT_USER }}
283
80
TEST_SETUP_TOKEN : ${{ secrets.GH_TOKEN_STAGING_BOT_USER }}
284
-
285
- - name : Print Proxy Logs
286
- if : always()
287
- run : cat /tmp/mitmproxy.log
0 commit comments