Skip to content

Commit

Permalink
Remove unused --verbose feature from pack build command utils (#738)
Browse files Browse the repository at this point in the history
Since:
- this feature was exposed internally only and was unused
- the use cases that might have warranted exposing verbose
  mode through the public APIs are redundant after upstream
  `lifecycle` improvements:
  #383 (comment)

GUS-W-14502304.
  • Loading branch information
edmorley authored Nov 16, 2023
1 parent e030d1c commit 66d148b
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions libcnb-test/src/pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub(crate) struct PackBuildCommand {
path: PathBuf,
pull_policy: PullPolicy,
trust_builder: bool,
verbose: bool,
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -67,7 +66,6 @@ impl PackBuildCommand {
// Prevent redundant image-pulling, which slows tests and risks hitting registry rate limits.
pull_policy: PullPolicy::IfNotPresent,
trust_builder: true,
verbose: false,
}
}

Expand Down Expand Up @@ -119,10 +117,6 @@ impl From<PackBuildCommand> for Command {
command.arg("--trust-builder");
}

if pack_build_command.verbose {
command.arg("--verbose");
}

command
}
}
Expand Down Expand Up @@ -183,7 +177,6 @@ mod tests {
path: PathBuf::from("/tmp/foo/bar"),
pull_policy: PullPolicy::IfNotPresent,
trust_builder: true,
verbose: true,
};

let command: Command = input.clone().into();
Expand All @@ -210,7 +203,6 @@ mod tests {
"--env",
"ENV_FOO=FOO_VALUE",
"--trust-builder",
"--verbose"
]
);

Expand All @@ -222,11 +214,6 @@ mod tests {
assert!(!command
.get_args()
.any(|arg| arg == OsStr::new("--trust-builder")));

// Assert conditional '--verbose' flag works as expected:
input.verbose = false;
let command: Command = input.into();
assert!(!command.get_args().any(|arg| arg == OsStr::new("--verbose")));
}

#[test]
Expand Down

0 comments on commit 66d148b

Please sign in to comment.