Watch
0
0
Fork
You've already forked hyperhive
0

overlay config .git only when the source has one; record a failed start in the op output

This commit is contained in:
atlas 2026-11-01 12:17:31 +01:00 • committed by mara
commit 23b0c4cd55

View file

@ -514,3 +514,20 @@ fn hive_facts_leave_unset_values_out() {
assert_eq!(facts.egress_no_proxy, None);
assert_eq!(facts.name, None);
}
/// A failed `start` leaves its error in the op's build-log row; without it the
/// row is empty. A missing row id records nothing and does not panic.
#[test]
fn a_failed_start_puts_its_error_in_the_op_output() {
let dir = tempfile::tempdir().expect("tempdir");
let logs = crate::build_logs::BuildLogs::open(dir.path()).expect("open");
let id = logs
.start("updo", "start", "nixos-container start h-updo", None)
.expect("start");
let err = anyhow::anyhow!("nixos-container start h-updo failed (exit status: 1): Job failed");
record_failure(Some(&logs), Some(id), &err);
let full = logs.get_full(id).expect("get").expect("row");
assert!(full.stderr.contains("Job failed"), "{}", full.stderr);
record_failure(Some(&logs), None, &err);
record_failure(None, Some(id), &err);
}