Drafted with AI assistance. The example uses synthetic test data.
A proxy-based API check has a blind spot: a test runner can exit successfully even if its requests never went through the proxy. A client might ignore proxy environment variables, or an entry in NO_PROXY might bypass the host under test. If zero observed failures counts as success, a broken test setup looks healthy.
Start with a positive control
Pick a harmless endpoint in a staging environment you control. Call it using the same HTTP client and configuration as the test suite. Verify that the expected method, host and path appear in the current capture. A successful curl command only tells you that curl is configured correctly.
Deliberately disable proxy routing for that client and check that your gate notices the missing traffic. Then restore routing and verify a known-good request. For HTTPS, configure the runner to trust your capture CA using its supported trust settings.
Make missing evidence visible
- Pass: The gate evaluated the selected traffic and found no failures.
- Fail: A captured response failed a check you selected.
- Inconclusive: No traffic was observed, or the check had insufficient evidence.
If the reporting request itself fails, surface that as a tooling error. It helps whoever is on call distinguish a failed API check from a failed reporting service.
Apply it to your capture
Proxycept’s CI verdict can check captured responses for server errors, response contract violations, and a p95 latency threshold. Start with the 5xx rule so you can verify the plumbing first.
Use a dedicated test profile. Record the newest flow before tests run and request a verdict for flows after that boundary. Give concurrent jobs separate profiles so one job cannot satisfy another job’s traffic check. If there is no capture session at all, report that as inconclusive in the wrapper.
After you fetch a verdict into a shell variable, handle the outcomes explicitly:
outcome=$(jq -er '.result' <<<"$verdict") || exit 3
case "$outcome" in
pass) exit 0 ;;
fail) exit 1 ;;
inconclusive) exit 2 ;;
*) exit 3 ;;
esac
Keep the original test runner’s exit code if the tests themselves fail. For an enforced gate, make inconclusive nonzero so that no captured evidence can’t silently pass the build.
Try three runs before enforcing the gate: a good staging response, a deliberate 5xx from the test fixture, and a run with routing disabled. Read the evidence from each run.
I’m the founder of Proxycept. The CI verdict guide has the full wrapper and optional JUnit output.
Top comments (0)