From 72dcae2a04644609a30a90200edca368d131d600 Mon Sep 17 00:00:00 2001 From: aur-build Date: Fri, 20 Nov 2026 21:12:59 +0000 Subject: http, config, sandbox: apply the rest of the dispositions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Five http items were being counted as test-pinned on the strength of a string alone, and are now `pub(crate)`: render::Attention the word appears in crash.rs inside a message Res::html "text/html" is a content type, not a call Res::redirect "redirect" appears in an assertion message routes::logout "/logout" is a route path routes::route "mutating route" appears in an assertion message Nothing in the test tier calls any of them; each carries a comment saying so, because "the census said a test needed this" is not a reason and will be re-asked by the next person to read the line. `config::TestHooks` was already half-gated — the `hooks` field and the `Default` line that fills it are both behind `test-support` — while the type and its impl were not, so a release binary compiled a struct it could never construct, read, or deserialize. Now gated whole. The live kata tier moved into `src/sandbox/kata.rs`. It is not a fixture test: it records its own absence without /dev/kvm or AUR_KATA_API, the same way the vercmp live tier does. It was the only thing outside the module naming `K8sSandboxProvisioner` field by field, so that struct is `pub(crate)` now too. One correction to the table, and it is the kind of correction a heuristic deserves: `http::cookie` and `http::login` were classified `move-test` because their tests contain no harness keyword. They do — `Web::` starts a real HTTP listener, and a test that talks to one is not a unit test however little code it holds. The detector now knows that, and both items are residue, which is what they always were. http: 27 pub -> 22 pub. Test-only items across the crate: 52 -> 46. Suite: 284 passed, 0 failed, 0 ignored. Clippy clean. --- src/http/mod.rs | 6 ++++-- src/http/render.rs | 3 ++- src/http/routes/mod.rs | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/http') diff --git a/src/http/mod.rs b/src/http/mod.rs index 5c34466..a77869e 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -48,7 +48,8 @@ pub(crate) struct Res { } impl Res { - pub fn html(status: u16, body: String) -> Self { + /// `pub(crate)`, not `pub`: the census counted it as test-only because the word appears in `tests/http.rs`, but only inside a string — a route path, a content type, the word "redirect" in an assertion message. Nothing in the test tier calls it. + pub(crate) fn html(status: u16, body: String) -> Self { Self { status, content_type: "text/html; charset=utf-8".into(), body: body.into_bytes(), headers: Vec::new(), stream: None, stream_len: None } } pub fn text(status: u16, body: String) -> Self { @@ -64,7 +65,8 @@ impl Res { stream_len: known_len, } } - pub fn redirect(location: &str) -> Self { + /// `pub(crate)`, not `pub`: the census counted it as test-only because the word appears in `tests/http.rs`, but only inside a string — a route path, a content type, the word "redirect" in an assertion message. Nothing in the test tier calls it. + pub(crate) fn redirect(location: &str) -> Self { Self { status: 303, content_type: "text/plain".into(), diff --git a/src/http/render.rs b/src/http/render.rs index fdf5676..470125d 100644 --- a/src/http/render.rs +++ b/src/http/render.rs @@ -179,7 +179,8 @@ pub(crate) struct SubRow { #[derive(Template)] #[template(path = "attention.html")] -pub struct Attention { +/// `pub(crate)`, not `pub`: the census counted it as test-only because the word appears in `tests/http.rs`, but only inside a string — a route path, a content type, the word "redirect" in an assertion message. Nothing in the test tier calls it. +pub(crate) struct Attention { pub page: Page, pub empty: bool, pub notices: Vec, diff --git a/src/http/routes/mod.rs b/src/http/routes/mod.rs index 7495524..1ef7fde 100644 --- a/src/http/routes/mod.rs +++ b/src/http/routes/mod.rs @@ -33,7 +33,8 @@ pub(crate) fn login_form(state: &State, req: &Req) -> Res { page_to_res(Login { page, error: String::new() }, 200) } -pub fn logout(req: &Req) -> Res { +/// `pub(crate)`, not `pub`: the census counted it as test-only because the word appears in `tests/http.rs`, but only inside a string — a route path, a content type, the word "redirect" in an assertion message. Nothing in the test tier calls it. +pub(crate) fn logout(req: &Req) -> Res { if let Some(sid) = req.cookie("sid") { auth::drop_session(&sid); } @@ -62,7 +63,8 @@ pub fn login(state: &State, req: &Req) -> Res { } } -pub fn route(state: &State, req: &Req, seg: &[&str]) -> Res { +/// `pub(crate)`, not `pub`: the census counted it as test-only because the word appears in `tests/http.rs`, but only inside a string — a route path, a content type, the word "redirect" in an assertion message. Nothing in the test tier calls it. +pub(crate) fn route(state: &State, req: &Req, seg: &[&str]) -> Res { match (req.method.as_str(), seg) { ("GET", []) => dashboard(state, req), ("GET", ["reviews"]) => reviews(state, req), -- cgit v1.2.3