Skip to content

Clean up test code - #911

Draft
seanses wants to merge 2 commits into
mainfrom
di/clean-up-client-testing
Draft

Clean up test code#911
seanses wants to merge 2 commits into
mainfrom
di/clean-up-client-testing

Conversation

@seanses

@seanses seanses commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Deduplicates the CAS simulation test harness by removing the older #[cfg(test)] LocalTestServer that lived inside local_server/server.rs.

That type was a second, nearly identical copy of the public harness in simulation_server.rs (LocalTestServer + LocalTestServerBuilder):

  • both spawn LocalServer, wire a RemoteClient/RemoteSimulationClient, and expose the backing DirectAccessClient
  • both re-implemented the full Client + DirectAccessClient passthrough by hand
  • both owned overlapping “run all server checks” suites (upload / reconstruction / fetch_term / …)

The server.rs copy was the older, narrower helper (in-memory vs temp-disk, optional socket). The public builder is the one external tests and simulation tooling already use (LocalTestServerBuilder, network/latency profiles, ephemeral disk/socket, deletion wiring). Keeping both meant every trait method and many HTTP checks had to be maintained twice, and unique coverage (notably V2 reconstruction checks) was trapped on the private harness.

What changed

  • Deleted the private LocalTestServer (+ trait passthrough) from local_server/server.rs
  • Migrated remaining unique tests there onto LocalTestServerBuilder
  • Added LocalTestServerBuilder::with_deletion_client so pre-supplied backends can still expose /simulation/ deletion routes
  • Moved V2 reconstruction HTTP checks into simulation_server.rs’s shared run_all_server_checks

Net: ~1k lines of duplicate harness removed; one canonical way to stand up a local CAS for tests.

Test plan

  • cargo test --package xet-client --features simulation --lib simulation_server::tests::test_local_server
  • cargo test --package xet-client --features simulation --lib local_server::server::tests
  • cargo clippy -r --package xet-client --features simulation -- -D warnings

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant