Skip to main content

Module conform

Module conform 

Source
Expand description

The D18 executor conformance suite, runnable against a helper this repository cannot build.

The assertions themselves used to live only in choir-queue/tests/it/executor.rs, which gates the four backends cargo can link. That is every backend except the one the seam was carved out for: a Firecracker or Cloud Hypervisor driver needs KVM, so it is written and run on a Linux machine, and a suite it cannot be pointed at gates nothing. Same checks, same order, in the library instead, with choir-ci-conform as the caller that takes a helper argv.

conform reports rather than panics. A remote helper is usually wrong in more than one way at once, and a suite that stops at the first assertion costs a round trip per defect. The one exception is the handshake: nothing after it means anything if the far side is not the protocol we speak, so its failure skips the rest rather than producing seven derived ones.

§Examples

use choir_queue::conform::{conform, Fixtures, Outcome};
use choir_queue::executor::Job;
use choir_queue::remote::ProtocolRunner;

let subject = choir_hash::ContentHash::blake3(b"conform");
let sh = |script: &str| {
    Job::new(subject.clone(), vec!["/bin/sh".into(), "-c".into(), script.into()])
};
let mut slow = sh("sleep 30");
slow.deadline = std::time::Duration::from_millis(100);
let checks = conform(
    &mut ProtocolRunner::new(vec!["choir-ci-local".to_string()]),
    Fixtures {
        passing: sh("exit 0"),
        failing: sh("exit 3"),
        erroring: Job::new(subject.clone(), vec!["/nonexistent/helper".into()]),
        slow,
        in_directory: None,
    },
);
assert!(checks.iter().all(|c| !matches!(c.outcome, Outcome::Failed(_))));

Structs§

Check
One named check and its outcome.
Fixtures
Jobs meaningful to one backend.

Enums§

Outcome
What one check found.

Functions§

conform
Every check an implementation of CiExecutor must satisfy.