summaryrefslogtreecommitdiffstats
path: root/tests/remote_agent.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/remote_agent.rs')
-rw-r--r--tests/remote_agent.rs21
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"] {