nightly vm test: full single-host swarm setup up to the meta flake
This commit is contained in:
parent
c490c72413
commit
af434e1374
1 changed files with 559 additions and 26 deletions
|
|
@ -583,6 +583,41 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
/// `testdata/meta-flake-swarm.nix.in` is the flake `nix/vm-tests/full-setup.nix`
|
||||
/// evaluates and serves: two archetype agents, the seven forwarded values a
|
||||
/// single-host swarm without a display name sets, each as `@<NAME>@`, and
|
||||
/// `@HYPERHIVE_URL@` where the pin goes. It must be what [`render_flake`]
|
||||
/// renders for them.
|
||||
#[test]
|
||||
fn the_full_setup_fixture_is_what_render_flake_renders() {
|
||||
let archetype = || {
|
||||
Some(ArchetypeRef {
|
||||
source: "hyperhive".to_owned(),
|
||||
name: "reviewer".to_owned(),
|
||||
})
|
||||
};
|
||||
let vars: Vec<(&'static str, String)> = FORWARDED_VARS
|
||||
.iter()
|
||||
.filter(|name| **name != "HYPERHIVE_SWARM_NAME")
|
||||
.map(|&name| (name, format!("@{name}@")))
|
||||
.collect();
|
||||
let flake = render_flake(
|
||||
"@HYPERHIVE_URL@",
|
||||
&[
|
||||
spec("iris", archetype(), None),
|
||||
spec("ruth", archetype(), None),
|
||||
],
|
||||
&vars,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
flake,
|
||||
include_str!("../testdata/meta-flake-swarm.nix.in"),
|
||||
"update the fixture to the rendered flake"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_rendered_flake_names_the_commit_each_input_is_pinned_to() {
|
||||
let flake = rendered();
|
||||
|
|
|
|||
Loading…
Reference in a new issue