tangled
alpha
login
or
join now
althaea.zone
/
wire
2
fork
atom
ALPHA: wire is a tool to deploy nixos systems
wire.althaea.zone/
2
fork
atom
overview
issues
pulls
pipelines
add test for force_always_local
marshmallow
4 months ago
abfb2298
115b27c1
+32
2 changed files
expand all
collapse all
unified
split
tests
rust
non_trivial_hive
hive.nix
wire
lib
src
hive
mod.rs
+2
tests/rust/non_trivial_hive/hive.nix
···
35
35
source = "hi";
36
36
};
37
37
38
38
+
deployment.buildOnTarget = true;
39
39
+
38
40
nixpkgs.hostPlatform = "x86_64-linux";
39
41
};
40
42
}
+30
wire/lib/src/hive/mod.rs
···
195
195
upload_at: UploadKeyAt::PreActivation,
196
196
environment: im::HashMap::new()
197
197
}],
198
198
+
build_remotely: true,
198
199
..Default::default()
199
200
};
200
201
···
270
271
})
271
272
if logs.contains("The option `deployment._keys' is read-only, but it's set multiple times.")
272
273
);
274
274
+
}
275
275
+
276
276
+
#[tokio::test]
277
277
+
async fn test_force_always_local() {
278
278
+
let mut location: PathBuf = env::var("WIRE_TEST_DIR").unwrap().into();
279
279
+
location.push("non_trivial_hive");
280
280
+
let location = location!(location);
281
281
+
282
282
+
let mut hive = Hive::new_from_path(&location, SubCommandModifiers::default())
283
283
+
.await
284
284
+
.unwrap();
285
285
+
286
286
+
assert_matches!(
287
287
+
hive.force_always_local(vec!["non-existant".to_string()]),
288
288
+
Err(HiveLibError::HiveInitializationError(
289
289
+
HiveInitializationError::NodeDoesNotExist(node)
290
290
+
)) if node == "non-existant"
291
291
+
);
292
292
+
293
293
+
for node in hive.nodes.values() {
294
294
+
assert!(node.build_remotely);
295
295
+
}
296
296
+
297
297
+
assert_matches!(
298
298
+
hive.force_always_local(vec!["node-a".to_string()]),
299
299
+
Ok(())
300
300
+
);
301
301
+
302
302
+
assert!(!hive.nodes.get(&Name("node-a".into())).unwrap().build_remotely);
273
303
}
274
304
}