compare complement test results to a baseline

One thing that might be neat in the future is noticing differing results
while the tests are still running, and modifying the log messages to
indicate them. I can imagine situations where you would want to abort
the test run immediately after seeing the first regression.
This commit is contained in:
Benjamin Lee 2024-06-21 16:33:51 -07:00
parent ab883ffa44
commit 8eab6eea20
No known key found for this signature in database
GPG key ID: FB9624E2885D55A4
4 changed files with 481 additions and 6 deletions

View file

@ -14,7 +14,7 @@ use std::{
use indicatif::{ProgressBar, ProgressStyle};
use miette::{miette, IntoDiagnostic, LabeledSpan, Result, WrapErr};
use serde::Deserialize;
use strum::Display;
use strum::{Display, EnumString};
use xshell::{cmd, Shell};
use super::summary::{write_summary, TestResults};
@ -43,7 +43,7 @@ pub(crate) fn run_complement(
out: &Path,
docker_image: &str,
test_count: u64,
) -> Result<()> {
) -> Result<TestResults> {
// TODO: handle SIG{INT,TERM}
// TODO: XTASK_PATH variable, so that we don't need to pollute devshell with
// go
@ -70,7 +70,7 @@ pub(crate) fn run_complement(
ctx.handle_line(&line)?;
}
Ok(())
Ok(ctx.results)
}
/// Schema from <https://pkg.go.dev/cmd/test2json#hdr-Output_Format>
@ -103,7 +103,7 @@ enum GoTestEvent {
OtherAction,
}
#[derive(Copy, Clone, Display, Debug)]
#[derive(Copy, Clone, Display, EnumString, Eq, PartialEq, Debug)]
#[strum(serialize_all = "UPPERCASE")]
pub(crate) enum TestResult {
Pass,