@@ -190,9 +190,50 @@ jobs:
190190 sleep 1
191191 done
192192
193- # Force mitmproxy to generate CA cert
193+ # Force mitmproxy to generate CA cert and test script capture
194194 curl -x http://127.0.0.1:8080 https://example.com -k || true
195195
196+ # Give script a moment to process the request
197+ sleep 3
198+
199+ # Check if the proxy script is working
200+ script_working=false
201+
202+ # Check log file exists
203+ if [ ! -f "mitm_script.log" ]; then
204+ echo "❌ FATAL: mitm_script.log not created - proxy script failed to start"
205+ exit 1
206+ fi
207+
208+ echo "✅ Log file created, checking contents..."
209+ cat mitm_script.log
210+
211+ # Check if the example.com request was captured in CSV
212+ if [ -f "test_requests.csv" ]; then
213+ echo "✅ CSV file created"
214+ if grep -q "example.com" test_requests.csv; then
215+ echo "✅ example.com request captured - script is working!"
216+ # Remove example.com from CSV since it was just a test
217+ sed -i '/example\.com/d' test_requests.csv
218+ echo "example.com test request removed from CSV"
219+ script_working=true
220+ else
221+ echo "❌ example.com request NOT found in CSV"
222+ echo "CSV contents:"
223+ cat test_requests.csv
224+ fi
225+ else
226+ echo "❌ CSV file not created"
227+ fi
228+
229+ # Fail pipeline if proxy script isn't capturing requests
230+ if [ "$script_working" = false ]; then
231+ echo "❌ FATAL: Proxy script is not capturing requests properly"
232+ echo "Log file contents:"
233+ cat mitm_script.log
234+ exit 1
235+ fi
236+
196237 # Wait for CA cert to be created
197238 timeout=30
198239 while [ ! -f ~/.mitmproxy/mitmproxy-ca-cert.pem ] && [ $timeout -gt 0 ]; do
@@ -288,7 +329,9 @@ jobs:
288329 uses : actions/upload-artifact@v4
289330 with :
290331 name : mitmproxy-artifacts-${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
291- path : test_requests.csv
332+ path : |
333+ test_requests.csv
334+ mitm_script.log
292335
293336
294337 test-olddriver :
0 commit comments