Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package e2etfcapi | |
import ( | |
"context" | |
"testing" | |
tfe "github.com/hashicorp/go-tfe" | |
"github.com/hashicorp/go-uuid" | |
"github.com/stretchr/testify/assert" | |
"github.com/stretchr/testify/require" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
tfe = { | |
version = "~> 0.24.0" | |
} | |
} | |
} | |
provider "tfe" { | |
hostname = "tfe-zone-4c292d5b.ngrok.io" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
cloud { | |
hostname = "app.terraform.io" | |
organization = "omar-test" | |
workspaces { | |
name = "app" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
cloud { | |
hostname = "app.terraform.io" | |
organization = "omar-test" | |
workspaces { | |
tags = ["app"] | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
backend "local" { | |
} | |
} | |
output "env" { | |
value = "${terraform.workspace}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
backend "remote" { | |
hostname = "app.staging.terraform.io" | |
organization = "omar-test" | |
workspaces { | |
prefix = "app-" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
backend "remote" { | |
hostname = "app.staging.terraform.io" | |
organization = "omar-test" | |
workspaces { | |
name = "app" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
backend "s3" { | |
bucket = "tf-backend-omar" | |
region = "us-east-1" | |
acl = "public-read" | |
} | |
} | |
output "env" { |
We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.
Let’s create our table driven test, for convenience, I chose to use t.Log
as the test function.
Notice that we don't have any assertion in this test, it is not needed to for the demonstration.
func TestTLog(t *testing.T) {
t.Parallel()