add complement wrapper xtask script

This commit is contained in:
Benjamin Lee 2024-06-20 19:06:57 -07:00
parent 3f89bc4a7c
commit ef6eb27b9b
No known key found for this signature in database
GPG key ID: FB9624E2885D55A4
10 changed files with 292 additions and 0 deletions

View file

@ -0,0 +1,19 @@
//! Functions for working with the go [`test2json`][test2json] tool.
//!
//! [test2json]: https://pkg.go.dev/cmd/test2json@go1.22.4
use miette::{IntoDiagnostic, Result};
use xshell::{cmd, Shell};
/// Runs complement test suite
pub(crate) fn run_complement(sh: &Shell, docker_image: &str) -> Result<()> {
// TODO: handle SIG{INT,TERM}
// TODO: XTASK_PATH variable, so that we don't need to pollute devshell with
// go
cmd!(sh, "go tool test2json complement.test -test.v=test2json")
.env("COMPLEMENT_BASE_IMAGE", docker_image)
.env("COMPLEMENT_SPAWN_HS_TIMEOUT", "5")
.env("COMPLEMENT_ALWAYS_PRINT_SERVER_LOGS", "1")
.run()
.into_diagnostic()
}