cli: Add support for multiple commands with `anchor test` (#2799)
This commit is contained in:
parent
616dd239c3
commit
94fde24339
|
@ -22,6 +22,7 @@ The minor version will be incremented upon a breaking change and the patch versi
|
|||
- ts: Add IdlSeed Type for IDL PDA seeds ([#2752](https://github.com/coral-xyz/anchor/pull/2752)).
|
||||
- cli: `idl close` accepts optional `--idl-address` parameter ([#2760](https://github.com/coral-xyz/anchor/pull/2760)).
|
||||
- cli: Add support for simple wildcard patterns in Anchor.toml's `workspace.members` and `workspace.exclude`. ([#2785](https://github.com/coral-xyz/anchor/pull/2785)).
|
||||
- cli: `anchor test` is able to run multiple commands ([#2799](https://github.com/coral-xyz/anchor/pull/2799)).
|
||||
|
||||
### Fixes
|
||||
|
||||
|
|
|
@ -3201,14 +3201,10 @@ fn run_test_suite(
|
|||
.get("test")
|
||||
.expect("Not able to find script for `test`")
|
||||
.clone();
|
||||
let mut args: Vec<&str> = cmd
|
||||
.split(' ')
|
||||
.chain(extra_args.iter().map(|arg| arg.as_str()))
|
||||
.collect();
|
||||
let program = args.remove(0);
|
||||
|
||||
std::process::Command::new(program)
|
||||
.args(args)
|
||||
let script_args = format!("{cmd} {}", extra_args.join(" "));
|
||||
std::process::Command::new("bash")
|
||||
.arg("-c")
|
||||
.arg(script_args)
|
||||
.env("ANCHOR_PROVIDER_URL", url)
|
||||
.env("ANCHOR_WALLET", cfg.provider.wallet.to_string())
|
||||
.env("NODE_OPTIONS", node_options)
|
||||
|
|
Loading…
Reference in New Issue