cli/tests: Fix nextest running via Nix
This commit is contained in:
parent
9988b63bb2
commit
ee12f76cbe
|
|
@ -4,3 +4,4 @@
|
||||||
/build/*.tar.gz
|
/build/*.tar.gz
|
||||||
/.pre-commit-config.yaml
|
/.pre-commit-config.yaml
|
||||||
/.direnv/
|
/.direnv/
|
||||||
|
/result
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,8 @@
|
||||||
# avoid timeouts
|
# avoid timeouts
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
patchShebangs --build radicle-cli/examples/rad-cob-multiset
|
patchShebangs --build radicle-cli/examples/rad-cob-multiset
|
||||||
cargo build -p radicle-remote-helper --target-dir radicle-cli/target
|
cargo build -p radicle-remote-helper --target-dir radicle-cli/target
|
||||||
cargo build -p radicle-cli --target-dir radicle-cli/target
|
cargo build -p radicle-cli --target-dir radicle-cli/target
|
||||||
'';
|
'';
|
||||||
# Ensure dev is used since we rely on env variables being
|
# Ensure dev is used since we rely on env variables being
|
||||||
# set in tests.
|
# set in tests.
|
||||||
|
|
|
||||||
|
|
@ -208,16 +208,16 @@ fn rad_cob_multiset() {
|
||||||
// `rad-cob-multiset` is a `jq` script, which requires `jq` to be installed.
|
// `rad-cob-multiset` is a `jq` script, which requires `jq` to be installed.
|
||||||
// We test whether `jq` is installed, and have this test succeed if it is not.
|
// We test whether `jq` is installed, and have this test succeed if it is not.
|
||||||
// Programmatic skipping of tests is not supported as of 2024-08.
|
// Programmatic skipping of tests is not supported as of 2024-08.
|
||||||
|
use std::io::ErrorKind;
|
||||||
|
use std::process::{Command, Stdio};
|
||||||
|
|
||||||
let output = std::process::Command::new("/usr/bin/env")
|
match Command::new("jq").arg("-V").stdout(Stdio::null()).status() {
|
||||||
.arg("jq")
|
Err(e) if e.kind() == ErrorKind::NotFound => {
|
||||||
.arg("-V")
|
log::warn!(target: "test", "`jq` not found. Succeeding prematurely.");
|
||||||
.output()
|
return;
|
||||||
.unwrap();
|
}
|
||||||
|
Err(e) => panic!("while checking for jq: {}", e),
|
||||||
if !output.status.success() {
|
Ok(_) => {}
|
||||||
log::warn!(target: "test", "`jq` not found. Succeeding prematurely. {:?}", output);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue