From da92d9dadf1e95977ff3bb804ad90104a9aa2634 Mon Sep 17 00:00:00 2001 From: Merlin Fisher-Levine Date: Wed, 29 Apr 2026 15:15:00 +0100 Subject: [PATCH] Drop host/port/scheme from VCR match_on so cassettes replay anywhere The cassettes were recorded with HTTPS_PROXY active at USDF, baking sdfproxy.sdf.slac.stanford.edu:3128 into every URI. Outside USDF (and seemingly now also at USDF, after some library or NO_PROXY drift) the host/port matchers reject every replay. The recorded paths uniquely identify each service, so matching on method/path/query/body is enough and makes replay independent of proxy state. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/utils.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 70199cd76..17031462e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -30,12 +30,13 @@ def getVcr(): """Get a VCR object for use in tests. Use record_mode="none" to run tests for normal operation. To update files - or generate new ones, make sure you have a working connection to the EFD at - all the relevant sites, and temporarily run with mode="all" via *both* - python/pytest *and* with scons, as these generate slightly different HTTP - requests for some reason. Also make sure to do all this at both the summit - and USDF. The TTS is explicitly skipped and does not need to follow this - procedure. + or generate new ones, make sure you have a working connection to the EFD + and temporarily run with mode="all" via *both* python/pytest *and* with + scons, as these generate slightly different HTTP requests for some reason. + Also make sure to do this at the summit (USDF coverage is provided by the + same recording, since matching ignores host/port and so is independent of + whether requests go through a proxy). The TTS is explicitly skipped and + does not need to follow this procedure. """ dirname = os.path.dirname(__file__) cassette_library_dir = os.path.join(dirname, "data", "cassettes") @@ -43,6 +44,6 @@ def getVcr(): record_mode="none", cassette_library_dir=cassette_library_dir, path_transformer=vcr.VCR.ensure_suffix(".yaml"), - match_on=["method", "scheme", "host", "port", "path", "query", "body"], + match_on=["method", "path", "query", "body"], ) return safe_vcr