hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io
Other
42.76k stars 9.56k forks source link

FAIL: TestConsulClient #4421

Closed sw25481 closed 8 years ago

sw25481 commented 8 years ago

I am trying to compile Terraform as I need to develop some additional plugins to work with internal systems.

I can compile it just fine on a Cloud hosted vanilla server, (as long as I fix the windows-line-endings.tf https://groups.google.com/forum/#!topic/terraform-tool/C8puepxkqAg)

Behind the proxy and firewall we have at work the unit test for the following fails

github.com/hashicorp/terraform/state/remote/remote_test.go

which as far as I can tell is actually being called from

github.com/hashicorp/terraform/state/remote/consul_test.go

It appears to test that connectivity is available to Google, (which is is), and then tries to download a binary file of some kind from demo.consul.io:80, (which is not allowed here).

Does anyone know how to work around this failure? Sadly I can't change the proxy/firewall rules and I can't use a binary distribution

Here is the full output

==> Checking that code complies with gofmt requirements...
go generate ./...
TF_ACC= go test ./...  -timeout=30s -parallel=4
ok      github.com/hashicorp/terraform  0.015s
ok      github.com/hashicorp/terraform/builtin/bins/provider-atlas  0.027s
ok      github.com/hashicorp/terraform/builtin/bins/provider-aws    0.006s
ok      github.com/hashicorp/terraform/builtin/bins/provider-azure  0.008s
?       github.com/hashicorp/terraform/builtin/bins/provider-azurerm    [no test files]
?       github.com/hashicorp/terraform/builtin/bins/provider-chef   [no test files]
ok      github.com/hashicorp/terraform/builtin/bins/provider-cloudflare 0.007s
ok      github.com/hashicorp/terraform/builtin/bins/provider-cloudstack 0.006s
ok      github.com/hashicorp/terraform/builtin/bins/provider-consul 0.007s
ok      github.com/hashicorp/terraform/builtin/bins/provider-digitalocean   0.007s
ok      github.com/hashicorp/terraform/builtin/bins/provider-dme    0.006s
ok      github.com/hashicorp/terraform/builtin/bins/provider-dnsimple   0.007s
ok      github.com/hashicorp/terraform/builtin/bins/provider-docker 0.027s
ok      github.com/hashicorp/terraform/builtin/bins/provider-dyn    0.006s
ok      github.com/hashicorp/terraform/builtin/bins/provider-google 0.007s
ok      github.com/hashicorp/terraform/builtin/bins/provider-heroku 0.011s
ok      github.com/hashicorp/terraform/builtin/bins/provider-mailgun    0.007s
ok      github.com/hashicorp/terraform/builtin/bins/provider-mysql  0.006s
ok      github.com/hashicorp/terraform/builtin/bins/provider-null   0.005s
?       github.com/hashicorp/terraform/builtin/bins/provider-openstack  [no test files]
?       github.com/hashicorp/terraform/builtin/bins/provider-packet [no test files]
ok      github.com/hashicorp/terraform/builtin/bins/provider-postgresql 0.006s
?       github.com/hashicorp/terraform/builtin/bins/provider-rundeck    [no test files]
?       github.com/hashicorp/terraform/builtin/bins/provider-statuscake [no test files]
?       github.com/hashicorp/terraform/builtin/bins/provider-template   [no test files]
ok      github.com/hashicorp/terraform/builtin/bins/provider-terraform  0.007s
?       github.com/hashicorp/terraform/builtin/bins/provider-tls    [no test files]
?       github.com/hashicorp/terraform/builtin/bins/provider-vcd    [no test files]
ok      github.com/hashicorp/terraform/builtin/bins/provider-vsphere    0.010s
ok      github.com/hashicorp/terraform/builtin/bins/provisioner-chef    0.007s
ok      github.com/hashicorp/terraform/builtin/bins/provisioner-file    0.006s
ok      github.com/hashicorp/terraform/builtin/bins/provisioner-local-exec  0.005s
ok      github.com/hashicorp/terraform/builtin/bins/provisioner-remote-exec 0.007s
ok      github.com/hashicorp/terraform/builtin/providers/atlas  0.006s
ok      github.com/hashicorp/terraform/builtin/providers/aws    0.337s
ok      github.com/hashicorp/terraform/builtin/providers/azure  0.075s
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    0.005s
ok      github.com/hashicorp/terraform/builtin/providers/chef   0.006s
ok      github.com/hashicorp/terraform/builtin/providers/cloudflare 0.005s
ok      github.com/hashicorp/terraform/builtin/providers/cloudstack 0.007s
ok      github.com/hashicorp/terraform/builtin/providers/consul 0.006s
ok      github.com/hashicorp/terraform/builtin/providers/digitalocean   0.006s
ok      github.com/hashicorp/terraform/builtin/providers/dme    0.006s
ok      github.com/hashicorp/terraform/builtin/providers/dnsimple   0.005s
ok      github.com/hashicorp/terraform/builtin/providers/docker 0.023s
ok      github.com/hashicorp/terraform/builtin/providers/dyn    0.006s
ok      github.com/hashicorp/terraform/builtin/providers/google 0.052s
ok      github.com/hashicorp/terraform/builtin/providers/heroku 0.031s
ok      github.com/hashicorp/terraform/builtin/providers/mailgun    0.006s
ok      github.com/hashicorp/terraform/builtin/providers/mysql  0.005s
ok      github.com/hashicorp/terraform/builtin/providers/null   0.008s
ok      github.com/hashicorp/terraform/builtin/providers/openstack  0.014s
ok      github.com/hashicorp/terraform/builtin/providers/packet 0.005s
ok      github.com/hashicorp/terraform/builtin/providers/postgresql 0.005s
ok      github.com/hashicorp/terraform/builtin/providers/rundeck    0.010s
ok      github.com/hashicorp/terraform/builtin/providers/statuscake 0.005s
ok      github.com/hashicorp/terraform/builtin/providers/template   0.006s
ok      github.com/hashicorp/terraform/builtin/providers/terraform  0.006s
ok      github.com/hashicorp/terraform/builtin/providers/tls    0.006s
ok      github.com/hashicorp/terraform/builtin/providers/vcd    0.005s
ok      github.com/hashicorp/terraform/builtin/providers/vsphere    0.010s
ok      github.com/hashicorp/terraform/builtin/provisioners/chef    0.103s
ok      github.com/hashicorp/terraform/builtin/provisioners/file    0.005s
ok      github.com/hashicorp/terraform/builtin/provisioners/local-exec  0.032s
ok      github.com/hashicorp/terraform/builtin/provisioners/remote-exec 0.021s
ok      github.com/hashicorp/terraform/command  2.590s
ok      github.com/hashicorp/terraform/communicator 0.012s
ok      github.com/hashicorp/terraform/communicator/remote  0.008s
ok      github.com/hashicorp/terraform/communicator/ssh 0.039s
ok      github.com/hashicorp/terraform/communicator/winrm   0.018s
ok      github.com/hashicorp/terraform/config   1.298s
ok      github.com/hashicorp/terraform/config/lang  0.004s
ok      github.com/hashicorp/terraform/config/lang/ast  0.004s
ok      github.com/hashicorp/terraform/config/module    0.599s
ok      github.com/hashicorp/terraform/dag  0.013s
ok      github.com/hashicorp/terraform/digraph  0.008s
?       github.com/hashicorp/terraform/dot  [no test files]
ok      github.com/hashicorp/terraform/flatmap  0.003s
ok      github.com/hashicorp/terraform/helper/config    0.006s
ok      github.com/hashicorp/terraform/helper/diff  0.009s
ok      github.com/hashicorp/terraform/helper/hashcode  0.008s
?       github.com/hashicorp/terraform/helper/logging   [no test files]
ok      github.com/hashicorp/terraform/helper/mutexkv   0.055s
ok      github.com/hashicorp/terraform/helper/pathorcontents    0.038s
ok      github.com/hashicorp/terraform/helper/resource  1.360s
ok      github.com/hashicorp/terraform/helper/schema    0.021s
ok      github.com/hashicorp/terraform/plugin   0.161s
ok      github.com/hashicorp/terraform/rpc  0.029s
ok      github.com/hashicorp/terraform/state    0.024s
2015/12/22 16:03:08 [DEBUG] Handling Atlas conflict response: Conflict
2015/12/22 16:03:08 [DEBUG] Atlas reported conflict, checking for equivalent states.
2015/12/22 16:03:08 [DEBUG] States are equivalent, incrementing serial and retrying.
2015/12/22 16:03:08 [DEBUG] Handling Atlas conflict response: Conflict
2015/12/22 16:03:08 [DEBUG] Atlas reported conflict, checking for equivalent states.
2015/12/22 16:03:08 [DEBUG] States are not equivalent, returning conflict.
2015/12/22 16:03:08 [DEBUG] Handling Atlas conflict response: Conflict
2015/12/22 16:03:08 [DEBUG] Atlas reported conflict, checking for equivalent states.
2015/12/22 16:03:08 [DEBUG] States are equivalent, incrementing serial and retrying.
2015/12/22 16:03:08 [DEBUG] Handling Atlas conflict response: Conflict
2015/12/22 16:03:08 [DEBUG] Already attempted conflict resolution; returning conflict.
--- FAIL: TestConsulClient (0.29s)
    remote_test.go:21: put: Unexpected response code: 405 (<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
        <html><head>
        <title>405 Method Not Allowed</title>
        </head><body>
        <h1>Method Not Allowed</h1>
        <p>The requested method PUT is not allowed for the URL /v1/kv/tf-unit/2015-12-22 16:03:08.719812833 +0000 GMT.</p>
        </body></html>
        )
FAIL
FAIL    github.com/hashicorp/terraform/state/remote 1.638s
ok      github.com/hashicorp/terraform/terraform    7.777s
make: *** [test] Error 1
phinze commented 8 years ago

Thanks for this report! In the attached PR I added a TF_SKIP_REMOTE_TESTS env var you can set to opt out of the tests that interact with the network.

Hope this helps!

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.