DimensionDataResearch / terraform-provider-ddcloud

Terraform provider for Dimension Data cloud compute.
MIT License
16 stars 13 forks source link

testing #123

Closed samuelchong closed 5 years ago

samuelchong commented 5 years ago

@tintoy Could you provide some guide to running the Acceptance test? When running 'make testacc' , all the tests failed with

testing.go:548: Step 0 error: config is invalid: 2 problems:

How to define provider.ddcloud for test?

tintoy commented 5 years ago

That message means you can specify cloudcontrol_endpoint in the config HCL (e.g. as shown here), or you can specify region, but you can't specify both at once.

tintoy commented 5 years ago

(as specified here and here).

samuelchong commented 5 years ago

Thx @tintoy. All the tests specify region only; for some reason it still thinks that region and cloudcontrol_endpoint are both defined. I had to comment out https://github.com/DimensionDataResearch/dd-cloud-compute-terraform/blob/13b1f3e84a4225e88d912fadd54886e8253c8565/ddcloud/provider.go#L28 and https://github.com/DimensionDataResearch/dd-cloud-compute-terraform/blob/13b1f3e84a4225e88d912fadd54886e8253c8565/ddcloud/provider.go#L35 as a temporary workaround while executing the test.

... === RUN TestAccVirtualListenerBasicUpdateName --- FAIL: TestAccVirtualListenerBasicUpdateName (0.02s) testing.go:548: Step 0 error: config is invalid: 2 problems:

            - "region": conflicts with cloudcontrol_endpoint
            - "cloudcontrol_endpoint": conflicts with region

=== RUN TestAccVLANBasicCreate --- FAIL: TestAccVLANBasicCreate (0.02s) testing.go:548: Step 0 error: config is invalid: 2 problems:

            - "region": conflicts with cloudcontrol_endpoint
            - "cloudcontrol_endpoint": conflicts with region

=== RUN TestAccVLANBasicUpdate --- FAIL: TestAccVLANBasicUpdate (0.01s) testing.go:548: Step 0 error: config is invalid: 2 problems:

            - "cloudcontrol_endpoint": conflicts with region
            - "region": conflicts with cloudcontrol_endpoint

...

tintoy commented 5 years ago

Maybe because both have a default value that isn’t nil?

samuelchong commented 5 years ago

that might be the case. Will look into that when I've got a bit of time. Thx @tintoy