add a per-agent nix builds mode, host or none, carried like privateUsers
This commit is contained in:
parent
b9484e62a0
commit
5485151ba6
1 changed files with 618 additions and 58 deletions
|
|
@ -211,6 +211,7 @@ pub async fn cache_built(
|
|||
out_path,
|
||||
system,
|
||||
private_users,
|
||||
nix_builds,
|
||||
..
|
||||
},
|
||||
) = (cache, &reply)
|
||||
|
|
@ -238,6 +239,7 @@ pub async fn cache_built(
|
|||
system: system.clone(),
|
||||
cached: true,
|
||||
private_users: *private_users,
|
||||
nix_builds: *nix_builds,
|
||||
}
|
||||
}
|
||||
Err(reason) => {
|
||||
|
|
@ -252,6 +254,8 @@ mod tests {
|
|||
use std::os::unix::fs::PermissionsExt as _;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
use hive_types::NixBuilds;
|
||||
|
||||
use super::*;
|
||||
|
||||
const TOKEN: &str = "eyJ0b2tlbiI6InNlY3JldCJ9.c2lnbmVk";
|
||||
|
|
@ -263,6 +267,7 @@ mod tests {
|
|||
system: "x86_64-linux".to_owned(),
|
||||
cached: false,
|
||||
private_users: false,
|
||||
nix_builds: NixBuilds::Disabled,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -294,6 +299,17 @@ mod tests {
|
|||
let cache = cache_with("true");
|
||||
let reply = cache_built(built(), Some(&cache), token(), PUSH_DEADLINE, "atlas").await;
|
||||
assert!(cached(&reply), "{reply:?}");
|
||||
// The rewritten reply keeps what the evaluated config said.
|
||||
assert!(
|
||||
matches!(
|
||||
reply,
|
||||
FromMetaReply::Built {
|
||||
nix_builds: NixBuilds::Disabled,
|
||||
..
|
||||
}
|
||||
),
|
||||
"{reply:?}"
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue