@@ -17,271 +17,64 @@ defaults:
1717 shell : bash -leo pipefail {0}
1818
1919jobs :
20- setup-repositories :
21- name : Set up Integration Tests
20+ integration-tests :
21+ name : Run Integration Tests
2222 # if triggered by pull_request, only run on non-fork PRs (secrets access needed)
2323 # Nevertheless, this check is always run in the merge queue.
2424 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
2525 runs-on : ubuntu-latest
26- outputs :
27- scenario_ids : ${{ steps.setup_repositories.outputs.scenario_ids }}
2826 steps :
27+ - name : Set up Docker Buildx
28+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
29+
2930 - name : Checkout
3031 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3132 with :
3233 path : cf-scripts
33-
34- - name : Set up Docker Buildx
35- uses : docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
34+ submodules : ' true'
3635
3736 - name : Build Docker Image
38- uses : docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11 .0
37+ uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15 .0
3938 with :
4039 context : cf-scripts
4140 push : false
4241 load : true
4342 tags : conda-forge-tick:test
4443 cache-from : type=gha
4544 cache-to : type=gha,mode=max
46- outputs : type=docker,dest=/tmp/image.tar
4745
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
5048 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
5850 environment-name : cf-scripts
59- condarc-file : cf-scripts/ autotick-bot/condarc
51+ condarc-file : autotick-bot/condarc
6052
6153 - name : Run pip install
6254 working-directory : cf-scripts
6355 run : |
6456 pip install --no-deps --no-build-isolation -e .
6557
66- - name : Set up Integration Test Repositories
67- id : setup_repositories
58+ - name : Run mitmproxy certificate setup wizard
6859 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
12360 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
13467 sudo update-ca-certificates
135- env :
136- SCENARIO_ID : ${{ matrix.scenario_id }}
137- PYTHONPATH : ${{ github.workspace }}/cf-scripts
68+ EOF
13869
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
24671 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
26274
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
27976 working-directory : cf-scripts
280- run : python -m tests_integration.step_validate
77+ run : pytest -s -v tests_integration
28178 env :
282- SCENARIO_ID : ${{ matrix.scenario_id }}
79+ BOT_TOKEN : ${{ secrets.GH_TOKEN_STAGING_BOT_USER }}
28380 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