mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-05-26 13:03:36 -04:00
``` › PGSSLMODE=disable PGHOST=localhost PGUSER=postgres make testacc \ TEST=./builtin/providers/postgresql ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2016/09/05 15:39:23 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/postgresql -v -timeout 120m === RUN TestProvider --- PASS: TestProvider (0.00s) === RUN TestProvider_impl --- PASS: TestProvider_impl (0.00s) === RUN TestAccPostgresqlDatabase_Basic --- PASS: TestAccPostgresqlDatabase_Basic (0.53s) === RUN TestAccPostgresqlDatabase_DefaultOwner --- PASS: TestAccPostgresqlDatabase_DefaultOwner (0.51s) === RUN TestAccPostgresqlRole_Basic --- PASS: TestAccPostgresqlRole_Basic (0.11s) PASS ok github.com/hashicorp/terraform/builtin/providers/postgresql 1.160s ```
43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
package postgresql
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/schema"
|
|
"github.com/hashicorp/terraform/terraform"
|
|
)
|
|
|
|
var testAccProviders map[string]terraform.ResourceProvider
|
|
var testAccProvider *schema.Provider
|
|
|
|
func init() {
|
|
testAccProvider = Provider().(*schema.Provider)
|
|
testAccProviders = map[string]terraform.ResourceProvider{
|
|
"postgresql": testAccProvider,
|
|
}
|
|
}
|
|
|
|
func TestProvider(t *testing.T) {
|
|
if err := Provider().(*schema.Provider).InternalValidate(); err != nil {
|
|
t.Fatalf("err: %s", err)
|
|
}
|
|
}
|
|
|
|
func TestProvider_impl(t *testing.T) {
|
|
var _ terraform.ResourceProvider = Provider()
|
|
}
|
|
|
|
func testAccPreCheck(t *testing.T) {
|
|
var host string
|
|
if host = os.Getenv("PGHOST"); host == "" {
|
|
t.Fatal("PGHOST must be set for acceptance tests")
|
|
}
|
|
if v := os.Getenv("PGUSER"); v == "" {
|
|
t.Fatal("PGUSER must be set for acceptance tests")
|
|
}
|
|
if v := os.Getenv("PGPASSWORD"); v == "" && host != "localhost" {
|
|
t.Fatal("PGPASSWORD must be set for acceptance tests if PGHOST is not localhost")
|
|
}
|
|
}
|