Research for Provider Availability Cassettes
| Decision | Rationale | Alternatives considered |
|---|---|---|
| Reuse pytest and the repository's VCR integration, with explicit replay-only behavior and an opt-in recording path. | Recreation.gov, ReserveCalifornia, and Washington State Parks already have HTTP replays. ReserveCalifornia and Washington match request bodies as well as URLs. The Recreation.gov case iterates over results without asserting that any were returned. | Provider mocks alone would skip the real transport and response parsing. Live CI would depend on inventory and network access. |
| Use the provider registry as the coverage baseline and assign each case a stable provider-qualified ID. | The registry contains 26 concrete implementations, including regional deployments with different endpoints and configuration. A named case can be collected, run, and refreshed independently. | One case per family would miss deployment-specific changes. IDs based on dates would change at every refresh. |
| Exercise the real provider adapter and the existing foreground availability search for equipment cases. | BaseProvider.find_availabilities accepts a campground and dates. camply.core.search.check_availability calls the adapter and applies campsite type and minimum vehicle length through normal matching. Its existing today argument supports historical replay. Verify provider-night bounds on the adapter output and use the matching path for compatible and excluded sites. | Building a second implementation of equipment filtering in test code would allow production matching regressions to pass. |
| Treat booking-site observations and replay expectations as separate evidence. | Record which site and nights were publicly observed for the requested equipment before asserting the normalized result. For an exclusion, establish that the same campground and nights have a known available site whose equipment is incompatible. Use a paired or unfiltered observation if the upstream request already excludes that site. | Copying expectations from the same code under test would let mapping defects become the baseline. |
| Stage candidate recordings and promote only after sanitization and offline replay. | Recording can fail mid-search or produce an empty result. A scoped staging location keeps existing cassettes available and limits replacement to the selected scenario. Review headers, URLs, bodies, and retained responses, preserving only the necessary public inventory and using synthetic test/session values. | In-place re-recording can destroy the last passing cassette while a campground is closed or the provider is down. |