Skip to content

Commit

Permalink
Make testdomain configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Bloemberg committed Apr 18, 2019
1 parent 3752494 commit cd13a67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions data_source_transip_domain_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"fmt"
"os"
"testing"

"github.com/hashicorp/terraform/helper/resource"
Expand All @@ -12,7 +14,7 @@ func TestAccTransipDataSourceDomain(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testConfig,
Config: fmt.Sprintf(testConfig, os.Getenv("TRANSIP_TEST_DOMAIN")),
Check: resource.ComposeTestCheckFunc(
// TODO: does TestCheckResourceAttrSet not work on lists?
// resource.TestCheckResourceAttrSet("data.transip_domain.test", "nameservers"),
Expand All @@ -25,6 +27,6 @@ func TestAccTransipDataSourceDomain(t *testing.T) {

var testConfig = `
data "transip_domain" "test" {
name = "locohost.nl"
name = "%s"
}
`
4 changes: 4 additions & 0 deletions provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ func testAccPreCheck(t *testing.T) {
if v := os.Getenv("TRANSIP_PRIVATE_KEY"); v == "" {
t.Fatal("TRANSIP_PRIVATE_KEY must be set for acceptance tests")
}

if v := os.Getenv("TRANSIP_TEST_DOMAIN"); v == "" {
t.Fatal("TRANSIP_TEST_DOMAIN must be set for acceptance tests")
}
}

0 comments on commit cd13a67

Please sign in to comment.