Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: Add --skip-build flag to anchor test resolve #276 #301

Merged
merged 2 commits into from
May 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ pub enum Command {
/// url is a localnet.
#[clap(long)]
skip_local_validator: bool,
/// Flag to skip building the program in the workspace,
/// use this to save time when running test and the program code is not altered.
#[clap(long)]
skip_build: bool,
/// Use this flag if you want to use yarn as your package manager.
#[clap(long)]
yarn: bool,
Expand Down Expand Up @@ -242,9 +246,10 @@ fn main() -> Result<()> {
Command::Test {
skip_deploy,
skip_local_validator,
skip_build,
yarn,
file,
} => test(skip_deploy, skip_local_validator, yarn, file),
} => test(skip_deploy, skip_local_validator, skip_build, yarn, file),
#[cfg(feature = "dev")]
Command::Airdrop { url } => airdrop(url),
Command::Cluster { subcmd } => cluster(subcmd),
Expand Down Expand Up @@ -925,14 +930,18 @@ enum OutFile {
fn test(
skip_deploy: bool,
skip_local_validator: bool,
skip_build: bool,
use_yarn: bool,
file: Option<String>,
) -> Result<()> {
with_workspace(|cfg, _path, _cargo| {
// Bootup validator, if needed.
let validator_handle = match cfg.cluster.url() {
"http://127.0.0.1:8899" => {
build(None, false)?;
match skip_build {
true => None,
false => Some(build(None, false)?),
};
let flags = match skip_deploy {
true => None,
false => Some(genesis_flags(cfg)?),
Expand Down