test(mounts): cover download range logic + add just coverage recipe

- Extract the WebDAV/REST mount-download Range decision (parse + validate +
  satisfiable) into a pure `plan_mount_range`, unit-tested across no-range,
  malformed, inclusive, open-ended, suffix, and out-of-bounds cases. This was
  the one untested branch of `download_mount_file` (its I/O deps are already
  integration-covered).
- Add `just coverage [filter]` and `just coverage-integration [filter]`
  recipes wrapping cargo-llvm-cov (HTML + summary; integration variant adds
  the testcontainers tests).
This commit is contained in:
Bradley Nelson
2026-06-25 01:11:45 -06:00
parent 07320a3925
commit 94e5aec4af
2 changed files with 142 additions and 52 deletions
+12
View File
@@ -50,6 +50,18 @@ test:
test-mocks:
cargo test --features test_utils
# Source-based line coverage (HTML + summary) via cargo-llvm-cov.
# Requires `cargo install cargo-llvm-cov` and llvm-tools (rustup component
# llvm-tools-preview, or set LLVM_COV / LLVM_PROFDATA to an llvm-binutils).
# Unit tests only (no DB). Pass a filter: `just coverage external_mount`.
coverage filter='':
cargo llvm-cov --lib --html {{ if filter == '' { '' } else { '--' } }} {{filter}}
cargo llvm-cov --lib --summary-only {{ if filter == '' { '' } else { '--' } }} {{filter}}
# Coverage including the testcontainers integration tests (needs docker).
coverage-integration filter='mount':
RUSTFLAGS='--cfg integration_tests' cargo llvm-cov --lib --summary-only -- {{filter}}
# DB-dependent integration tests gated on `--cfg integration_tests`.
# Spins up the test postgres on port 5433 first. Requires one row in
# auth.users on the test DB (start the server against it once to seed).