From 4304b0f336ddba7b4ec6780795059ff2066d105b Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 17:33:17 +0000 Subject: comments: keep only what the code cannot show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- tests/live.rs | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'tests/live.rs') diff --git a/tests/live.rs b/tests/live.rs index da0f7ec..e572638 100644 --- a/tests/live.rs +++ b/tests/live.rs @@ -9,7 +9,6 @@ use aur_build::pipeline; use aur_build::review::{candidates, diff}; use common::*; -/// Approve a fixture's candidate and enqueue its build without running it. fn queued(env: &Env, name: &str) -> String { aur_build::watch::detect::check_pkgbase(&env.cfg, &env.db, name).unwrap(); let c = candidates::pending_candidates(&env.db).unwrap().remove(0); @@ -20,7 +19,6 @@ fn queued(env: &Env, name: &str) -> String { pipeline::enqueue_for_candidate(&env.cfg, &env.db, &c).unwrap() } -/// Read a streaming response until EOF or the deadline, whichever comes first. fn drain(mut r: impl Read, deadline: Duration) -> String { let mut buf = [0u8; 4096]; let mut out = Vec::new(); @@ -47,8 +45,6 @@ fn the_log_stream_delivers_bytes_as_they_are_appended_and_then_ends() { std::fs::create_dir_all(log.parent().unwrap()).unwrap(); std::fs::write(&log, "==> step materialize\n").unwrap(); - // A producer appends while the stream is open, then finishes the build. If the - // endpoint buffered its response the "live" claim would be false. let db = web.env.db.clone(); let id2 = id.clone(); let log2 = log.clone(); @@ -58,8 +54,6 @@ fn the_log_stream_delivers_bytes_as_they_are_appended_and_then_ends() { std::thread::sleep(Duration::from_millis(400)); append(&log2, "==> step publish\n"); std::thread::sleep(Duration::from_millis(200)); - // Walk the machine the way a real build does: a queued build runs - // before it succeeds. builds::set_state(&db, &id2, BuildState::Running, None).unwrap(); builds::set_state(&db, &id2, BuildState::Succeeded, None).unwrap(); }); @@ -73,9 +67,7 @@ fn the_log_stream_delivers_bytes_as_they_are_appended_and_then_ends() { assert!(body.contains("data: ==> step materialize"), "the first line is missing: {body}"); assert!(body.contains("data: ==> step build"), "appended bytes never arrived: {body}"); assert!(body.contains("data: ==> step publish"), "the tail stopped early: {body}"); - // It ends when the build does, rather than holding the connection forever. assert!(body.contains("event: end"), "the stream never ended: {body}"); - // SSE framing: each log line is its own event, so a client can append. assert!(body.contains("\n\n"), "not event-framed: {body}"); } @@ -96,17 +88,13 @@ fn the_builds_table_refreshes_via_htmx_and_still_works_without_js() { let web = Web::attach(env, fx); let base = web.url("/builds"); - // One queued build so the table has a row. queued(&web.env, "plain-make"); let page = ureq::get(&base).call().unwrap().into_string().unwrap(); - // The refresh is an attribute on the table, not a script we wrote. assert!(page.contains("hx-trigger=\"every 3s\""), "no htmx refresh: {}", &page[..400.min(page.len())]); assert!(page.contains("hx-get=\"/builds?fragment=1\""), "the refresh has no target"); assert!(page.contains("