summaryrefslogtreecommitdiffstats
path: root/src/sandbox
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-22 10:44:04 +0000
committeraur-build <aur-build@localhost>2026-11-22 10:44:04 +0000
commit1e1e12e7220a3fd288782ae40f0823db32acf6cb (patch)
tree1e436bfbe305cbeccee93758e67d1ca11e3096e6 /src/sandbox
parent3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 (diff)
downloadaur-build-1e1e12e7220a3fd288782ae40f0823db32acf6cb.tar.gz
aur-build-1e1e12e7220a3fd288782ae40f0823db32acf6cb.zip
src,tests: say each thing once, in the code or not at all
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.
Diffstat (limited to 'src/sandbox')
-rw-r--r--src/sandbox/kata.rs23
1 files changed, 0 insertions, 23 deletions
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() {