terraform-provider-pulsar icon indicating copy to clipboard operation
terraform-provider-pulsar copied to clipboard

tests using localhost, when WEB_SERVICE_URL is set

Open mdjasper opened this issue 5 years ago • 2 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

0.12.20

Terraform Configuration Files

The tf configuration run during tests

Debug Output

https://gist.github.com/mdjasper/cd9de1c24132827cacb8498fc4a81f3f

Panic Output

Expected Behavior

I see that in initTestWebServiceURL the tests are looking for the env var WEB_SERVICE_URL. However, even when that is set, the tests are still trying to use the localhost default (see gist) When make testacc

Actual Behavior

Tests tried to connect to default localhost WEB_SERVICE_URL

Steps to Reproduce

  • cloned repo
  • go installed dependencies
  • local pulsar running in docker using docker-compose and dinghy
  • run make testacc

mdjasper avatar Feb 28 '20 17:02 mdjasper

I feel like there must be some configuration or setup step or something that I am missing.

When I run the tests like this WEB_SERVICE_URL=http://pulsar.pulsar.docker:8080 make testacc they still all try to use http://localhost:8080 for the tests.

mdjasper avatar Feb 28 '20 22:02 mdjasper

As some extra debugging help, the tests run correctly if I just pass in the url hardcoded, for example file resource_pulsar_cluster_test

var (
	testPulsarCluster = fmt.Sprintf(`
provider "pulsar" {
  web_service_url = "%s"
}

resource "pulsar_cluster" "test" {
  cluster = "eternals"

  cluster_data {
    web_service_url    = "http://pulsar.pulsar.docker:8080"
    broker_service_url = "http://pulsar.pulsar.docker:6050"
    peer_clusters      = ["skrulls", "krees"]
  }
}`, "http://pulsar.pulsar.docker:8080")  //formerly testWebServiceURL
)
15:48:29 › pulsar-admin --admin-url http://pulsar.pulsar.docker:8080 tenants list
public
sample
thanos

mdjasper avatar Feb 28 '20 22:02 mdjasper