ably / terraform-provider-ably

Ably's Terraform Provider, enabling you to manage your Ably account programmatically.
https://registry.terraform.io/providers/ably/ably
Apache License 2.0
11 stars 2 forks source link

Create acceptance tests for ably_app resource #42

Closed graham-russell closed 2 years ago

graham-russell commented 2 years ago

You can run the acceptance tests locally for now using make testacc. You will need Ably credentials set as env vars. GHA Workflow coming in separate step.

graham-russell commented 2 years ago

Example test output

TF_ACC=1 go test $(go list ./... | grep -v 'vendor') -v  -timeout 120m
?       terraform-provider-ably [no test files]
=== RUN   TestAccAblyApp
--- PASS: TestAccAblyApp (11.64s)
=== RUN   TestAccAblyAppDisabledStatus
    resource_ably_app_test.go:47: Step 1/1 error: Error running apply: exit status 1

        Error: Provider produced inconsistent result after apply

        When applying changes to ably_app.app0, provider
        "provider[\"github.com/ably/ably\"]" produced an unexpected new value:
        .status: was cty.StringVal("disabled"), but now cty.StringVal("enabled").

        This is a bug in the provider, which should be reported in the provider's own
        issue tracker.
--- FAIL: TestAccAblyAppDisabledStatus (4.37s)
FAIL
FAIL    terraform-provider-ably/internal/provider       16.305s
FAIL
make: *** [testacc] Error 1
kavalerov commented 2 years ago

It is failing right now when ABLY_URL is not set - should it just fall back to default URL when no env var is set?

graham-russell commented 2 years ago

It is failing right now when ABLY_URL is not set - should it just fall back to default URL when no env var is set?

I have now removed ABLY_URL env var check from the test pre-checks.