terratest
No long description provided.
Installation
dagger install github.com/Excoriate/daggerverse/terratest@v1.15.4
Entrypoint
Return Type
Terratest !
Arguments
Name | Type | Description |
---|---|---|
version | String | the Version of the Terraform to use, e.g., "0.12.24". by default, it uses the latest Version. |
tfVersion | String | the Version of the Terraform to use, e.g., "0.12.24". by default, it uses the latest Version. |
image | String | Image of the container to use. by default, it uses the official HashiCorp Terraform Image hashicorp/terraform. |
ctr | Container ! | ctr is the container to use as a base container. It's an optional parameter. If it's not set, it's going to create a new container. |
envVars | String | envVars is a string of environment variables in the form of "key1=value1,key2=value2" |
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG
func (m *myModule) example(ctr *Container) *Terratest {
return dag.
Terratest(ctr)
}
@function
def example(ctr: dagger.Container, ) -> dag.Terratest:
return (
dag.terratest(ctr)
)
@func()
example(ctr: Container, ): Terratest {
return dag
.terratest(ctr)
}
Types
Terratest 🔗
version() 🔗
The Version of the Golang image that’ll host the ‘terratest’ test
Return Type
String !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG version
func (m *myModule) example(ctx context.Context, ctr *Container) string {
return dag.
Terratest(ctr).
Version(ctx)
}
@function
async def example(ctr: dagger.Container, ) -> str:
return await (
dag.terratest(ctr)
.version()
)
@func()
async example(ctr: Container, ): Promise<string> {
return dag
.terratest(ctr)
.version()
}
tfVersion() 🔗
TfVersion is the Version of the Terraform to use, e.g., “0.12.24”. by default, it uses the latest Version.
Return Type
String !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG tf-version
func (m *myModule) example(ctx context.Context, ctr *Container) string {
return dag.
Terratest(ctr).
TfVersion(ctx)
}
@function
async def example(ctr: dagger.Container, ) -> str:
return await (
dag.terratest(ctr)
.tf_version()
)
@func()
async example(ctr: Container, ): Promise<string> {
return dag
.terratest(ctr)
.tfVersion()
}
image() 🔗
Image of the container to use.
Return Type
String !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG image
func (m *myModule) example(ctx context.Context, ctr *Container) string {
return dag.
Terratest(ctr).
Image(ctx)
}
@function
async def example(ctr: dagger.Container, ) -> str:
return await (
dag.terratest(ctr)
.image()
)
@func()
async example(ctr: Container, ): Promise<string> {
return dag
.terratest(ctr)
.image()
}
ctr() 🔗
Ctr is the container to use as a base container.
Return Type
Container !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG ctr
func (m *myModule) example(ctr *Container) *Container {
return dag.
Terratest(ctr).
Ctr()
}
@function
def example(ctr: dagger.Container, ) -> dagger.Container:
return (
dag.terratest(ctr)
.ctr()
)
@func()
example(ctr: Container, ): Container {
return dag
.terratest(ctr)
.ctr()
}
withSource() 🔗
WithSource Set the source directory.
Return Type
Terratest !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | Src is the directory that contains all the source code, including the module directory. |
workdir | String | - | workdir is the working directory. |
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG with-source --src DIR_PATH
func (m *myModule) example(ctr *Container, src *Directory) *Terratest {
return dag.
Terratest(ctr).
WithSource(src)
}
@function
def example(ctr: dagger.Container, src: dagger.Directory) -> dag.Terratest:
return (
dag.terratest(ctr)
.with_source(src)
)
@func()
example(ctr: Container, src: Directory): Terratest {
return dag
.terratest(ctr)
.withSource(src)
}
withCgoDisabled() 🔗
WithCgoDisabled Set CGO_ENABLED environment variable to 0.
Return Type
Terratest !
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG with-cgo-disabled
func (m *myModule) example(ctr *Container) *Terratest {
return dag.
Terratest(ctr).
WithCgoDisabled()
}
@function
def example(ctr: dagger.Container, ) -> dag.Terratest:
return (
dag.terratest(ctr)
.with_cgo_disabled()
)
@func()
example(ctr: Container, ): Terratest {
return dag
.terratest(ctr)
.withCgoDisabled()
}
withEnvVar() 🔗
WithEnvVar Set an environment variable.
Return Type
Terratest !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | The name of the environment variable (e.g., "HOST"). |
value | String ! | - | The value of the environment variable (e.g., "localhost"). |
expand | Boolean | - | Replace `${VAR}` or $VAR in the value according to the current environment variables defined in the container (e.g., "/opt/bin:$PATH"). |
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG with-env-var --name string --value string
func (m *myModule) example(ctr *Container, name string, value string) *Terratest {
return dag.
Terratest(ctr).
WithEnvVar(name, value)
}
@function
def example(ctr: dagger.Container, name: str, value: str) -> dag.Terratest:
return (
dag.terratest(ctr)
.with_env_var(name, value)
)
@func()
example(ctr: Container, name: string, value: string): Terratest {
return dag
.terratest(ctr)
.withEnvVar(name, value)
}
base() 🔗
Base sets up the Container with a golang image and cache volumes version string
Return Type
Terratest !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
goVersion | String ! | - | No description provided |
tfVersion | String ! | - | No description provided |
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG base --go-version string --tf-version string
func (m *myModule) example(ctr *Container, goVersion string, tfVersion string) *Terratest {
return dag.
Terratest(ctr).
Base(goVersion, tfVersion)
}
@function
def example(ctr: dagger.Container, go_version: str, tf_version: str) -> dag.Terratest:
return (
dag.terratest(ctr)
.base(go_version, tf_version)
)
@func()
example(ctr: Container, goVersion: string, tfVersion: string): Terratest {
return dag
.terratest(ctr)
.base(goVersion, tfVersion)
}
withContainer() 🔗
WithContainer specifies the container to use in the Terraform module.
Return Type
Terratest !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ctr | Container ! | - | No description provided |
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG with-container --ctr IMAGE:TAG
func (m *myModule) example(ctr *Container, ctr1 *Container) *Terratest {
return dag.
Terratest(ctr).
WithContainer(ctr1)
}
@function
def example(ctr: dagger.Container, ctr1: dagger.Container) -> dag.Terratest:
return (
dag.terratest(ctr)
.with_container(ctr1)
)
@func()
example(ctr: Container, ctr1: Container): Terratest {
return dag
.terratest(ctr)
.withContainer(ctr1)
}
run() 🔗
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
testDir | Directory ! | - | testDir is the directory that contains all the test code. |
args | String | - | args is the arguments to pass to the 'go test' command. |
Example
dagger -m github.com/Excoriate/daggerverse/terratest@9987052c010bcbdda3b4c148c2e7b3fe73817f91 call \
--ctr IMAGE:TAG run --test-dir DIR_PATH
func (m *myModule) example(ctr *Container, testDir *Directory) *Container {
return dag.
Terratest(ctr).
Run(testDir)
}
@function
def example(ctr: dagger.Container, test_dir: dagger.Directory) -> dagger.Container:
return (
dag.terratest(ctr)
.run(test_dir)
)
@func()
example(ctr: Container, testDir: Directory): Container {
return dag
.terratest(ctr)
.run(testDir)
}