Add a cache directory builder to test contexts (#21120)
Tests that replace `TestContext.cache_dir` directly leave snapshot
filters pointing at the original cache, and command-level `UV_CACHE_DIR`
overrides are ignored because the context supplies `--cache-dir`. Add
`TestContext::with_cache_dir` to configure the effective cache and its
snapshot filters together, resolve relative paths against the test
working directory, and use the builder for shared ecosystem caches.
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>