pub struct TestCommand { /* private fields */ }Expand description
Command for running Terraform module integration tests.
Runs .tftest.hcl test files. Available in Terraform 1.6+.
use terraform_wrapper::{Terraform, TerraformCommand};
use terraform_wrapper::commands::test::TestCommand;
let tf = Terraform::builder().working_dir("/tmp/infra").build()?;
let output = TestCommand::new()
.filter("my_test")
.verbose()
.execute(&tf)
.await?;Implementations§
Source§impl TestCommand
impl TestCommand
Sourcepub fn test_directory(self, path: &str) -> Self
pub fn test_directory(self, path: &str) -> Self
Set the directory containing test files (-test-directory).
Defaults to tests if not specified.
Sourcepub fn parallelism(self, n: u32) -> Self
pub fn parallelism(self, n: u32) -> Self
Limit the number of concurrent operations (-parallelism).
Trait Implementations§
Source§impl Clone for TestCommand
impl Clone for TestCommand
Source§fn clone(&self) -> TestCommand
fn clone(&self) -> TestCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TestCommand
impl Debug for TestCommand
Source§impl Default for TestCommand
impl Default for TestCommand
Source§fn default() -> TestCommand
fn default() -> TestCommand
Returns the “default value” for a type. Read more
Source§impl TerraformCommand for TestCommand
impl TerraformCommand for TestCommand
Source§type Output = CommandOutput
type Output = CommandOutput
The output type produced by this command.
Source§async fn execute(&self, tf: &Terraform) -> Result<CommandOutput>
async fn execute(&self, tf: &Terraform) -> Result<CommandOutput>
Execute this command against the given Terraform client.
Source§fn supports_input(&self) -> bool
fn supports_input(&self) -> bool
Whether this command supports the
-input=false flag. Read moreAuto Trait Implementations§
impl Freeze for TestCommand
impl RefUnwindSafe for TestCommand
impl Send for TestCommand
impl Sync for TestCommand
impl Unpin for TestCommand
impl UnsafeUnpin for TestCommand
impl UnwindSafe for TestCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more