From 1e1e12e7220a3fd288782ae40f0823db32acf6cb Mon Sep 17 00:00:00 2001 From: aur-build Date: Sun, 22 Nov 2026 10:44:04 +0000 Subject: src,tests: say each thing once, in the code or not at all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The repeated explanations go: sixteen copies of why a `pub` under `test-support` has two declarations, six notes about where a test moved from, forty-three banner comments naming the section they sit above. The prose that stays is the prose the code cannot say — a hand-written Debug that keeps a token out of a log line, a git pipe that would deadlock if the write came first, an end-of-string check that has to precede the separator skip. Enum docs in error.rs collapse to the line that names what the type is; the argument for why it is shaped that way is in the variants. --- src/sandbox/kata.rs | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/sandbox/kata.rs') diff --git a/src/sandbox/kata.rs b/src/sandbox/kata.rs index ca39c6b..e035fd6 100644 --- a/src/sandbox/kata.rs +++ b/src/sandbox/kata.rs @@ -358,21 +358,6 @@ mod tests { assert!(args.windows(2).any(|w| w[0] == "--token" && w[1] == "t0ken")); } - // ------------------------------------------------------------------ - // Moved verbatim from tests/kata.rs. Neither test builds a fixture or - // touches a database: one asserts the shape of the container record a - // lease provisions, the other that a sandbox which never dials in expires - // by TTL rather than hanging. Both are about this module's own machinery, - // which is what let `KataBackend`, `sandbox_cr`, `provision_request`, - // `shared_for` and `for_config` stop being part of the crate's interface. - // - // `Provisioner` and `ProvisionRequest` stayed public, and not by - // oversight: a `pub` implementor cannot implement a `pub(crate)` trait, - // and a `pub` trait method cannot take a `pub(crate)` parameter. Narrowing - // them would force `LocalAgentProvisioner` private, and the two tests that - // construct it drive a real sandbox agent through a fixture. - // ------------------------------------------------------------------ - fn agent_sandbox_config() -> Config { let tmp = tempfile::tempdir().unwrap(); std::fs::write( @@ -452,14 +437,6 @@ mod tests { assert!(err.to_string().contains("never dialed in"), "{err}"); } - // ------------------------------------------------------------------ - // Moved verbatim from tests/kata.rs. It is an opt-in live tier, not a - // fixture test: it records its own absence when there is no /dev/kvm or no - // AUR_KATA_API, exactly as the vercmp live tier does. It constructs the - // provisioner field by field, which is the only reason that struct was - // nameable from outside; with the test here, it no longer needs to be. - // ------------------------------------------------------------------ - #[test] fn the_live_kata_tier_is_recorded_not_silently_absent() { if !std::path::Path::new("/dev/kvm").exists() { -- cgit v1.2.3