dnsimple / terraform-provider-dnsimple

Terraform DNSimple provider.
https://www.terraform.io/docs/providers/dnsimple/
Mozilla Public License 2.0
21 stars 20 forks source link

Adds the zone data-source #44

Closed ecomba closed 3 years ago

ecomba commented 3 years ago

Allows to get information about a zone.

ecomba commented 3 years ago

Right now on this branch, I get the following, can you confirm? DO I need to change a setting somewhere to make tests pass?

==> Checking that code complies with gofmt requirements...
go test $(go list ./... |grep -v 'vendor') || exit 1
?       github.com/terraform-providers/terraform-provider-dnsimple      [no test files]
--- FAIL: TestProvider_sandbox (0.00s)
panic: interface conversion: interface {} is nil, not *dnsimple.Client [recovered]
        panic: interface conversion: interface {} is nil, not *dnsimple.Client

goroutine 8 [running]:
testing.tRunner.func1.2(0x1ac07e0, 0xc000391650)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1143 +0x332
testing.tRunner.func1(0xc0005c2d80)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1146 +0x4b6
panic(0x1ac07e0, 0xc000391650)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/runtime/panic.go:965 +0x1b9
github.com/terraform-providers/terraform-provider-dnsimple/dnsimple.TestProvider_sandbox(0xc0005c2d80)
        /Users/dos/Code/dnsimple/terraform-provider-dnsimple/dnsimple/provider_test.go:30 +0x1ae
testing.tRunner(0xc0005c2d80, 0x1c2fff0)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1193 +0xef
created by testing.(*T).Run
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1238 +0x2b3
FAIL    github.com/terraform-providers/terraform-provider-dnsimple/dnsimple     0.256s
FAIL
make: *** [test] Error 1

I've just ran the tests make test and make testacc (with all it's arguments DNSIMPLE_ACCOUNT, DNSIMPLE_TOKEN, DNSIMPLE_DOMAIN and DNSIMPLE_SANDBOX and all the tests passed. Not sure what's going on in your system.

terraform-provider-dnsimple [datasource_dnsimple_zone] % make test
==> Checking that code complies with gofmt requirements...
go test $(go list ./... |grep -v 'vendor') || exit 1
?       github.com/terraform-providers/terraform-provider-dnsimple  [no test files]
ok      github.com/terraform-providers/terraform-provider-dnsimple/dnsimple 0.382s
echo $(go list ./... |grep -v 'vendor') | \
        xargs -t -n4 go test  -timeout=30s -parallel=4
go test -timeout=30s -parallel=4 github.com/terraform-providers/terraform-provider-dnsimple github.com/terraform-providers/terraform-provider-dnsimple/dnsimple
?       github.com/terraform-providers/terraform-provider-dnsimple  [no test files]
ok      github.com/terraform-providers/terraform-provider-dnsimple/dnsimple 0.183s
 DNSIMPLE_ACCOUNT=EDITED DNSIMPLE_TOKEN="EDITED" DNSIMPLE_DOMAIN=EDITED DNSIMPLE_SANDBOX=true make testacc

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v  -timeout 120m
?       github.com/terraform-providers/terraform-provider-dnsimple  [no test files]
=== RUN   TestAccDNSimpleZoneRead
--- PASS: TestAccDNSimpleZoneRead (5.32s)
=== RUN   TestAccDnsimpleEmailForward_import
--- PASS: TestAccDnsimpleEmailForward_import (4.21s)
=== RUN   TestAccDnsimpleRecord_import
--- PASS: TestAccDnsimpleRecord_import (2.89s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_sandbox
--- PASS: TestProvider_sandbox (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccDNSimpleDomainCreate
--- PASS: TestAccDNSimpleDomainCreate (2.38s)
=== RUN   TestAccCheckDNSimpleEmailForwardConfig_Basic
--- PASS: TestAccCheckDNSimpleEmailForwardConfig_Basic (3.03s)
=== RUN   TestAccDNSimpleRecord_Basic
--- PASS: TestAccDNSimpleRecord_Basic (2.23s)
=== RUN   TestAccDNSimpleRecord_CreateMxWithPriority
--- PASS: TestAccDNSimpleRecord_CreateMxWithPriority (2.27s)
=== RUN   TestAccDNSimpleRecord_Updated
--- PASS: TestAccDNSimpleRecord_Updated (3.85s)
=== RUN   TestAccDNSimpleRecord_disappears
--- PASS: TestAccDNSimpleRecord_disappears (1.96s)
=== RUN   TestAccDNSimpleRecord_UpdatedMx
--- PASS: TestAccDNSimpleRecord_UpdatedMx (3.90s)
=== RUN   TestResourceExampleInstanceStateUpgradeV0
--- PASS: TestResourceExampleInstanceStateUpgradeV0 (0.00s)
PASS
ok      github.com/terraform-providers/terraform-provider-dnsimple/dnsimple 32.233s
onlyhavecans commented 3 years ago

@ecomba does any of this help?

dnsimple/terraform-provider-dnsimple 2❯ git status
On branch datasource_dnsimple_zone
Your branch is up to date with 'origin/datasource_dnsimple_zone'.

nothing to commit, working tree clean
dnsimple/terraform-provider-dnsimple ❯ env | grep DNSIMPLE
DNSIMPLE_TOKEN=<edited>TCWM
DNSIMPLE_DOMAIN=cool.story
DNSIMPLE_ACCOUNT=422
DNSIMPLE_SANDBOX=true
dnsimple/terraform-provider-dnsimple ❯ go version
go version go1.16.6 darwin/amd64
dnsimple/terraform-provider-dnsimple ❯ make test
==> Checking that code complies with gofmt requirements...
go test $(go list ./... |grep -v 'vendor') || exit 1
?       github.com/terraform-providers/terraform-provider-dnsimple      [no test files]
--- FAIL: TestProvider_sandbox (0.00s)
panic: interface conversion: interface {} is nil, not *dnsimple.Client [recovered]
        panic: interface conversion: interface {} is nil, not *dnsimple.Client

goroutine 13 [running]:
testing.tRunner.func1.2(0x1ac07e0, 0xc000099b60)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1143 +0x332
testing.tRunner.func1(0xc00051cd80)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1146 +0x4b6
panic(0x1ac07e0, 0xc000099b60)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/runtime/panic.go:965 +0x1b9
github.com/terraform-providers/terraform-provider-dnsimple/dnsimple.TestProvider_sandbox(0xc00051cd80)
        /Users/dos/Code/dnsimple/terraform-provider-dnsimple/dnsimple/provider_test.go:30 +0x1ae
testing.tRunner(0xc00051cd80, 0x1c2fff0)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1193 +0xef
created by testing.(*T).Run
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1238 +0x2b3
FAIL    github.com/terraform-providers/terraform-provider-dnsimple/dnsimple     0.270s
FAIL
make: *** [test] Error 1
dnsimple/terraform-provider-dnsimple 2❯ make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v  -timeout 120m
?       github.com/terraform-providers/terraform-provider-dnsimple      [no test files]
=== RUN   TestAccDNSimpleZoneRead
--- PASS: TestAccDNSimpleZoneRead (3.52s)
=== RUN   TestAccDnsimpleEmailForward_import
--- PASS: TestAccDnsimpleEmailForward_import (3.15s)
=== RUN   TestAccDnsimpleRecord_import
--- PASS: TestAccDnsimpleRecord_import (3.15s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_sandbox
--- PASS: TestProvider_sandbox (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccDNSimpleDomainCreate
--- PASS: TestAccDNSimpleDomainCreate (2.70s)
=== RUN   TestAccCheckDNSimpleEmailForwardConfig_Basic
--- PASS: TestAccCheckDNSimpleEmailForwardConfig_Basic (2.60s)
=== RUN   TestAccDNSimpleRecord_Basic
--- PASS: TestAccDNSimpleRecord_Basic (2.45s)
=== RUN   TestAccDNSimpleRecord_CreateMxWithPriority
--- PASS: TestAccDNSimpleRecord_CreateMxWithPriority (2.47s)
=== RUN   TestAccDNSimpleRecord_Updated
--- PASS: TestAccDNSimpleRecord_Updated (4.34s)
=== RUN   TestAccDNSimpleRecord_disappears
--- PASS: TestAccDNSimpleRecord_disappears (2.21s)
=== RUN   TestAccDNSimpleRecord_UpdatedMx
--- PASS: TestAccDNSimpleRecord_UpdatedMx (4.28s)
=== RUN   TestResourceExampleInstanceStateUpgradeV0
--- PASS: TestResourceExampleInstanceStateUpgradeV0 (0.00s)
PASS
ok      github.com/terraform-providers/terraform-provider-dnsimple/dnsimple     (cached)
dnsimple/terraform-provider-dnsimple ❯
ecomba commented 3 years ago

@ecomba does any of this help?

dnsimple/terraform-provider-dnsimple 2❯ git status
On branch datasource_dnsimple_zone
Your branch is up to date with 'origin/datasource_dnsimple_zone'.

nothing to commit, working tree clean
dnsimple/terraform-provider-dnsimple ❯ env | grep DNSIMPLE
DNSIMPLE_TOKEN=<edited>TCWM
DNSIMPLE_DOMAIN=cool.story
DNSIMPLE_ACCOUNT=422
DNSIMPLE_SANDBOX=true
dnsimple/terraform-provider-dnsimple ❯ go version
go version go1.16.6 darwin/amd64
dnsimple/terraform-provider-dnsimple ❯ make test
==> Checking that code complies with gofmt requirements...
go test $(go list ./... |grep -v 'vendor') || exit 1
?       github.com/terraform-providers/terraform-provider-dnsimple      [no test files]
--- FAIL: TestProvider_sandbox (0.00s)
panic: interface conversion: interface {} is nil, not *dnsimple.Client [recovered]
        panic: interface conversion: interface {} is nil, not *dnsimple.Client

goroutine 13 [running]:
testing.tRunner.func1.2(0x1ac07e0, 0xc000099b60)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1143 +0x332
testing.tRunner.func1(0xc00051cd80)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1146 +0x4b6
panic(0x1ac07e0, 0xc000099b60)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/runtime/panic.go:965 +0x1b9
github.com/terraform-providers/terraform-provider-dnsimple/dnsimple.TestProvider_sandbox(0xc00051cd80)
        /Users/dos/Code/dnsimple/terraform-provider-dnsimple/dnsimple/provider_test.go:30 +0x1ae
testing.tRunner(0xc00051cd80, 0x1c2fff0)
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1193 +0xef
created by testing.(*T).Run
        /Users/dos/.asdf/installs/golang/1.16.6/go/src/testing/testing.go:1238 +0x2b3
FAIL    github.com/terraform-providers/terraform-provider-dnsimple/dnsimple     0.270s
FAIL
make: *** [test] Error 1
dnsimple/terraform-provider-dnsimple 2❯ make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v  -timeout 120m
?       github.com/terraform-providers/terraform-provider-dnsimple      [no test files]
=== RUN   TestAccDNSimpleZoneRead
--- PASS: TestAccDNSimpleZoneRead (3.52s)
=== RUN   TestAccDnsimpleEmailForward_import
--- PASS: TestAccDnsimpleEmailForward_import (3.15s)
=== RUN   TestAccDnsimpleRecord_import
--- PASS: TestAccDnsimpleRecord_import (3.15s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_sandbox
--- PASS: TestProvider_sandbox (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccDNSimpleDomainCreate
--- PASS: TestAccDNSimpleDomainCreate (2.70s)
=== RUN   TestAccCheckDNSimpleEmailForwardConfig_Basic
--- PASS: TestAccCheckDNSimpleEmailForwardConfig_Basic (2.60s)
=== RUN   TestAccDNSimpleRecord_Basic
--- PASS: TestAccDNSimpleRecord_Basic (2.45s)
=== RUN   TestAccDNSimpleRecord_CreateMxWithPriority
--- PASS: TestAccDNSimpleRecord_CreateMxWithPriority (2.47s)
=== RUN   TestAccDNSimpleRecord_Updated
--- PASS: TestAccDNSimpleRecord_Updated (4.34s)
=== RUN   TestAccDNSimpleRecord_disappears
--- PASS: TestAccDNSimpleRecord_disappears (2.21s)
=== RUN   TestAccDNSimpleRecord_UpdatedMx
--- PASS: TestAccDNSimpleRecord_UpdatedMx (4.28s)
=== RUN   TestResourceExampleInstanceStateUpgradeV0
--- PASS: TestResourceExampleInstanceStateUpgradeV0 (0.00s)
PASS
ok      github.com/terraform-providers/terraform-provider-dnsimple/dnsimple     (cached)
dnsimple/terraform-provider-dnsimple ❯

The only difference I see is in the go version:

go version go version go1.16 darwin/amd64

Which should not have any impact (🙄 ) on the tests