diff options
| author | aur-build <aur-build@localhost> | 2026-11-22 10:36:24 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-22 10:36:24 +0000 |
| commit | 3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 (patch) | |
| tree | 7cc7169181b4bdd73fd8817f8c1d7cce6e6998a8 /tests/remote_agent.rs | |
| parent | 9dc9087d89891c6e5ef7e5dc084dd13c8611843e (diff) | |
| download | aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.tar.gz aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.zip | |
rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off
rustfmt.toml fixes the shape the tree is written in (120 columns, small
items kept on one line) and one canonical pass makes it the truth.
[lints.clippy] names the idiom lints worth enforcing and leaves out the
two that would add doc-comment boilerplate rather than remove it. The
tree pays them off here: write!/writeln! instead of push_str(&format!()),
let-else instead of match-on-Option, borrows where a thread entry point
only reads what it owns, no `&self` on a Copy state and no `self` nobody
reads.
ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and
value are now emitted by the same call instead of three.
Diffstat (limited to 'tests/remote_agent.rs')
| -rw-r--r-- | tests/remote_agent.rs | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/tests/remote_agent.rs b/tests/remote_agent.rs index 534b346..05a5832 100644 --- a/tests/remote_agent.rs +++ b/tests/remote_agent.rs @@ -43,10 +43,7 @@ fn a_full_build_runs_over_the_agent_protocol() { assert!(matches!(out, pipeline::Outcome::Succeeded { .. }), "{out:?}"); let log = std::fs::read_to_string(env.cfg.build_log_path(&id)).unwrap(); - assert!( - log.contains("Making package"), - "agent-streamed output must reach the build log:\n{log}" - ); + assert!(log.contains("Making package"), "agent-streamed output must reach the build log:\n{log}"); let shimlog = env.cfg.hooks.shim_dir.clone().unwrap(); assert_eq!(aur_build::shims::called_with(&shimlog, "makepkg", ""), 1); @@ -62,9 +59,7 @@ fn blobs_round_trip_over_the_wire_and_a_bad_token_is_refused() { .args(["--hub", &addr, "--token", "right-token", "--ttl", "30"]) .spawn() .expect("spawn sandbox-agent"); - let sbx = backend - .acquire(&SandboxSpec::new("extra-x86_64", "blob-test", Duration::from_secs(10))) - .unwrap(); + let sbx = backend.acquire(&SandboxSpec::new("extra-x86_64", "blob-test", Duration::from_secs(10))).unwrap(); let bytes = b"pinned artifact bytes".to_vec(); let digest = aur_build::hash::hex(&bytes); sbx.put(&digest, &mut std::io::Cursor::new(bytes.clone())).unwrap(); @@ -78,9 +73,8 @@ fn blobs_round_trip_over_the_wire_and_a_bad_token_is_refused() { .args(["--hub", &addr, "--token", "wrong-token", "--ttl", "30"]) .spawn() .expect("spawn sandbox-agent"); - let err = match backend.acquire(&SandboxSpec::new("extra-x86_64", "nope", Duration::from_secs(10))) { - Err(e) => e, - Ok(_) => panic!("a stranger's box must not be leased"), + let Err(err) = backend.acquire(&SandboxSpec::new("extra-x86_64", "nope", Duration::from_secs(10))) else { + panic!("a stranger's box must not be leased") }; assert!(err.to_string().contains("token"), "{err}"); let _ = bad.wait(); @@ -151,11 +145,8 @@ fn two_concurrent_builds_do_not_fight_over_the_listener() { let addr = format!("127.0.0.1:{}", free_port()); let (mut env, _fa, _fb) = env_with_two_fixtures("plain-make", "install-hooks"); env.cfg.max_concurrent_builds = 2; - env.cfg.sandbox = aur_build::config::Sandbox::Remote { - listen: addr.clone(), - token: "concurrent".into(), - shared_workspace: true, - }; + env.cfg.sandbox = + aur_build::config::Sandbox::Remote { listen: addr.clone(), token: "concurrent".into(), shared_workspace: true }; let mut ids = Vec::new(); for name in ["plain-make", "install-hooks"] { |
