summaryrefslogtreecommitdiffstats
path: root/tests/kata.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-19 17:33:17 +0000
committeraur-build <aur-build@localhost>2026-11-19 17:33:17 +0000
commit4304b0f336ddba7b4ec6780795059ff2066d105b (patch)
tree10edea744a1c2bf3fc363b4dc7f64abac8b1a0d3 /tests/kata.rs
parente757979f1a2afdbe7146066345bb9acd19d3b151 (diff)
downloadaur-build-4304b0f336ddba7b4ec6780795059ff2066d105b.tar.gz
aur-build-4304b0f336ddba7b4ec6780795059ff2066d105b.zip
comments: keep only what the code cannot show
Stripped every comment that described what an item does, documented its arguments or fields, or cited the design docs (§n, I-n, m-n, decision n). 2247 comments down to 83. What survives: the section dividers that segment the large modules, the secret-handling warnings, the agent wire-frame directions, and the few notes without which the code they attach to reads as redundant, reorderable, or unsound.
Diffstat (limited to 'tests/kata.rs')
-rw-r--r--tests/kata.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/tests/kata.rs b/tests/kata.rs
index 79bf9d6..f923ea2 100644
--- a/tests/kata.rs
+++ b/tests/kata.rs
@@ -12,8 +12,6 @@ use common::{env_with_fixture, shim_dir};
#[test]
fn a_provisioned_sandbox_rendezvous_and_runs_a_command() {
- // Real sandbox-agent process, real frames, real nonce-matched dial-in —
- // everything about the kata lease path except the VM.
let cfg = Config::default();
let prov = Arc::new(LocalAgentProvisioner::new(shim_dir().join("sandbox-agent")));
let backend = KataBackend::bind(&cfg, "127.0.0.1:0", "kata-token", prov.clone()).unwrap();
@@ -55,8 +53,6 @@ fn a_sandbox_that_never_dials_in_is_a_ttl_expiry_not_a_hang() {
#[test]
fn the_live_kata_tier_is_recorded_not_silently_absent() {
- // The §16a convention: a tier that needs hardware or infrastructure
- // announces its own skip rather than pretending to have run.
if !Path::new("/dev/kvm").exists() {
println!("note: no /dev/kvm on this host; the live kata tier is skipped, not passed");
return;
@@ -65,8 +61,6 @@ fn the_live_kata_tier_is_recorded_not_silently_absent() {
println!("note: /dev/kvm present but AUR_KATA_API unset; live kata tier still skipped");
return;
};
- // Recorded as reached: a real cluster lease. Kept minimal on purpose —
- // acquire, one command, reclaim.
let cfg = Config::default();
let prov = Arc::new(aur_build::sandbox::kata::K8sSandboxProvisioner {
api,
@@ -82,10 +76,6 @@ fn the_live_kata_tier_is_recorded_not_silently_absent() {
sbx.destroy().unwrap();
}
-// agent-sandbox as a configuration, not a wish: the path from a config file to
-// the CR that would boot a VM, asserted end to end from parsed JSON.
-
-/// A config file as an operator would write it, parsed by the real loader.
fn agent_sandbox_config() -> Config {
let tmp = tempfile::tempdir().unwrap();
std::fs::write(
@@ -135,7 +125,6 @@ fn an_agent_sandbox_config_provisions_a_kata_vm_per_lease() {
assert!(args.windows(2).any(|w| w[0] == "--agent-id" && w[1] == "sbx-nonce-9"));
assert!(args.windows(2).any(|w| w[0] == "--ttl" && w[1] == "77"));
- // The cluster coordinates come from the same config, not from a default.
let prov = aur_build::sandbox::kata::K8sSandboxProvisioner::for_config(&cfg).unwrap();
assert_eq!(prov.api, "https://k8s.test:6443");
assert_eq!(prov.namespace, "builds");
@@ -149,24 +138,18 @@ fn agent_sandbox_is_a_backend_not_a_fallthrough_to_loopback() {
let id = backend.status().unwrap()[0].id.clone();
assert!(id.contains("kata@"), "expected a kata backend, got {id}");
- // One backend per process, for the same reason the listener is: a second
- // concurrent build must not race the first for the dial-ins it routes.
let again = aur_build::sandbox::backend_for(&cfg).unwrap();
assert_eq!(again.status().unwrap()[0].id, id, "two builds must share one kata backend");
}
#[test]
fn a_loopback_config_never_becomes_agent_sandbox_or_vice_versa() {
- // The fallthrough in both directions, closed.
let local = Config::default();
let id = aur_build::sandbox::backend_for(&local).unwrap().status().unwrap()[0].id.clone();
assert!(!id.contains("kata@"), "loopback must not report kata: {id}");
assert!(!id.contains("remote@"), "loopback must not report remote: {id}");
}
-/// The seam's whole claim, tested as one thing: a real package built and published
-/// through the kata lease path, with a VM being the only thing this host cannot
-/// provide.
#[test]
fn a_fixture_builds_and_publishes_through_the_kata_lease_path() {
let (env, _fx) = env_with_fixture("plain-make");
@@ -189,22 +172,15 @@ fn a_fixture_builds_and_publishes_through_the_kata_lease_path() {
};
assert!(release > 0);
- // Published, not merely built: the served index now names the package.
let world = aur_build::pipeline::publish::index_world(&env.db).unwrap();
assert!(
world.iter().any(|w| w.pkgbase == "plain-make" && w.version == "1.0-1"),
"the index must serve what the kata build produced: {world:?}"
);
- // And it ran inside the leased sandbox: the agent streamed the build output over
- // the wire into the same log file the SSE tail reads.
let log = std::fs::read_to_string(env.cfg.build_log_path(&id)).unwrap();
assert!(log.contains("Making package"), "agent output must reach the log:\n{log}");
let shimlog = env.cfg.hooks.shim_dir.clone().unwrap();
assert_eq!(aur_build::shims::called_with(&shimlog, "makepkg", ""), 1);
-
- // Deliberately no assertion that the sandbox is gone: the design says the TTL is
- // the guarantee and destroy is courtesy (wire.rs). A busy hub holds up to
- // `steps x builds` sandboxes until their TTL bites.
}