Skip to content

Give the offline uv sandbox test a disposable cache #1268

Done

Description

@eowca

The offline uv sandbox test writes into the builder’s uv cache through its setup command and passes that same path to the sandbox as writable. Its cache falls back to Path.home() / ".cache/uv", and uv lock -q inherits the caller’s environment. A clean machine therefore needs host state that the test can write and a host uv discoverable on PATH. tests/test_sandbox.py:488 tests/test_sandbox.py:491 tests/test_sandbox.py:498 tests/test_sandbox.py:503.

On e90262769, I ran pytest tests/test_sandbox.py::test_real_sandbox_uv_run_offline with a synthetic HOME, an empty .cache/uv, and UV_CACHE_DIR unset. The test passed and created .cache/uv/.lock, CACHEDIR.TAG and cache metadata outside its pytest temporary tree. The production cache was untouched in the reproduction.

Acceptance

  • Use a pytest-owned uv cache for both lock setup and the sandbox. Run lock setup offline and explicitly supply the interpreter the suite is already using, so an empty uv Python download directory is sufficient.
  • With a working Bubblewrap and uv installed, the test passes offline against a clean HOME. An inherited UV_CACHE_DIR pointed at a sentinel directory remains unchanged, and the existing sandbox scratch and read-only checkout assertions still run.

Activity

  1. eowca commented on Nov 26, 2026

    @eowca
    ContributorAuthor

    Closing #1338 because its candidate fixture conflicts with the isolated fixture already on main. The merge resolution needs a new review, and the branch's inherited merge prevents a delta review on that PR. With main's fixture retained, the offline uv test passed in real Bubblewrap and left the inherited cache sentinel unchanged. This issue remains open for a fresh delivery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions