Simple terratest example with GCS modules. By the way special thanks to @romen for teaching me about terratest.
What you can do on top of this repository:
- Create a test for your module terraform
- Test create a real env on your google project, then destroy it
To smoothly interact with this repository please install following application in your local device:
- Linux only (
apt install build-essential
) - Golang (tested on go1.13.1)
- Terraform (tested on v0.12.19)
- pre-commit (tested on v1.17.0)
- Text editor (Vim, Visual Studio Code, Intellij Idea, etc.)
First thing first, make sure that all prerequisite(s) installed in your device, then clone this repository (make sure you have access to it)
~ git clone [email protected]:fourirakbar/go-terratest-example.git
~ cd go-terratest-example
~ make setup
~ go mod init test
~ cd test
~ go test -v gcp_gcs_test.go
- Integrate with jenkins
- Integrate with gitlab-ci
- Add more complex testing
- Add integration testing with other module
Name | Description | Type | Default | Required |
---|---|---|---|---|
force_destroy | Force destroy when deleting bucket | string | n/a | yes |
location | Location of the bucket | string | n/a | yes |
name | The name of the bucket | string | n/a | yes |
project | Project of the bucket | string | n/a | yes |
storage_class | Storage class of the bucket | string | n/a | yes |
Name | Description |
---|---|
bucket_url | Bucket URL of the bucket |
force_destroy | Force destroy of the bucket |
location | Location of the bucker |
name | Name of the bucket |
project | Project of the bucker |
storage_class | Storage class of the bucket |