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/crash.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/crash.rs')
| -rw-r--r-- | tests/crash.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/crash.rs b/tests/crash.rs index 1e72177..94469b8 100644 --- a/tests/crash.rs +++ b/tests/crash.rs @@ -68,10 +68,7 @@ fn a_process_killed_mid_step_resumes_from_its_checkpoints_with_no_duplicate_work env.exec("UPDATE build SET lease_expires_at='2000-01-01T00:00:00Z' WHERE id=?1", ¶ms(vec![id.as_str()])); assert_eq!(builds::reap_expired(&env.db).unwrap(), 1); - assert_eq!( - builds::step_status(&env.db, &id, "build").unwrap(), - Some(StepState::Interrupted) - ); + assert_eq!(builds::step_status(&env.db, &id, "build").unwrap(), Some(StepState::Interrupted)); env.cfg.hooks.shim_kill_parent = None; env.cfg.save().unwrap(); @@ -91,7 +88,10 @@ fn a_process_killed_mid_step_resumes_from_its_checkpoints_with_no_duplicate_work ); assert_eq!(aur_build::shims::called_with(&shim, "repo-add", ""), 1, "publish must happen once"); assert_eq!( - env.query_i64("SELECT count(*) FROM release WHERE pkgbase_id=(SELECT id FROM pkgbase WHERE name='plain-make')", &[]), + env.query_i64( + "SELECT count(*) FROM release WHERE pkgbase_id=(SELECT id FROM pkgbase WHERE name='plain-make')", + &[] + ), Some(1), "no duplicate release from the resume" ); @@ -137,7 +137,11 @@ fn a_failed_build_leaves_the_index_serving_the_old_version_and_says_so() { let web = Web::attach(env, fx); let attention = web.get("/attention"); - assert!(attention.body.contains("Approved but unbuilt"), "no Attention section: {}", &attention.body[..600.min(attention.body.len())]); + assert!( + attention.body.contains("Approved but unbuilt"), + "no Attention section: {}", + &attention.body[..600.min(attention.body.len())] + ); assert!(attention.body.contains("still serving 1.0-1"), "Attention does not say what is served"); let pkg = web.get("/packages/plain-make"); assert!(pkg.body.contains("build failed"), "the package page hides the failure"); |
