cli: Propagate mocha exit status on error
This commit is contained in:
parent
1ae8b52760
commit
79b791ffa8
|
@ -15,6 +15,10 @@ incremented for features.
|
|||
|
||||
* ts: Allow preloading instructions for state rpc transactions ([cf9c84](https://github.com/project-serum/anchor/commit/cf9c847e4144989b5bc1936149d171e90204777b)).
|
||||
|
||||
## Fixes
|
||||
|
||||
* cli: Propagates mocha test exit status on error.
|
||||
|
||||
## [0.2.1] - 2021-02-11
|
||||
|
||||
### Features
|
||||
|
|
|
@ -606,19 +606,20 @@ fn test(skip_deploy: bool) -> Result<()> {
|
|||
let log_streams = stream_logs(&cfg.cluster.url())?;
|
||||
|
||||
// Run the tests.
|
||||
if let Err(e) = std::process::Command::new("mocha")
|
||||
let exit = std::process::Command::new("mocha")
|
||||
.arg("-t")
|
||||
.arg("1000000")
|
||||
.arg("tests/")
|
||||
.env("ANCHOR_PROVIDER_URL", cfg.cluster.url())
|
||||
.stdout(Stdio::inherit())
|
||||
.stderr(Stdio::inherit())
|
||||
.output()
|
||||
{
|
||||
.output()?;
|
||||
|
||||
if !exit.status.success() {
|
||||
if let Some(mut validator_handle) = validator_handle {
|
||||
validator_handle.kill()?;
|
||||
}
|
||||
return Err(anyhow::format_err!("{}", e.to_string()));
|
||||
std::process::exit(exit.status.code().unwrap());
|
||||
}
|
||||
if let Some(mut validator_handle) = validator_handle {
|
||||
validator_handle.kill()?;
|
||||
|
|
Loading…
Reference in New Issue