Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

fix typos in terraform scripts for ami image #42

Closed
wants to merge 1 commit into from

Conversation

davisford
Copy link
Contributor

I took a look at running tests, but...

a) Costs money
b) Not sure which dep tool you're using but if its this one doesn't like not having $GOPATH/src and will not pull deps. Any reason why you don't just use the newer, built-in vendoring now and ditch the 3rd party tool?

Copy link
Member

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Costs money

Yes, it'll cost a few cents if you're no longer on the AWS free tier. Unfortunately, that's unavoidable with infrastructure. You either run automated tests or manual tests, but either way, you end up deploying into AWS, and that costs some amount of money. We can't accept PRs with no testing, as that will cost everyone far more.

Not sure which dep tool you're using but if its this one doesn't like not having $GOPATH/src and will not pull deps. Any reason why you don't just use the newer, built-in vendoring now and ditch the 3rd party tool?

As explained in the docs we use dep just as in you would expect.

@davisford
Copy link
Contributor Author

As explained in the docs we use dep just as in you would expect.

The dep tool doesn't like the non-standard structure for go code. Are you using an older version of the tool that doesn't have this problem? Might I suggest switching to go module and then you can ditch dep as a requirement?

ml-dford:test dford$ ls
Gopkg.lock                                      couchbase_multi_cluster_test.go                 docker_compose_test.go
Gopkg.toml                                      couchbase_multi_datacenter_replication_test.go  terratest_helpers.go
README.md                                       couchbase_single_cluster_dns_tls_test.go
couchbase_helpers.go                            couchbase_single_cluster_test.go

ml-dford:test dford$ dep version
dep:
 version     : v0.5.1
 build date  : 2019-03-11
 git hash    : faa6189
 go version  : go1.12
 go compiler : gc
 platform    : darwin/amd64
 features    : ImportDuringSolve=false

ml-dford:test dford$ dep ensure
/Users/dford/git/terraform-aws-couchbase/test is not within a known GOPATH/src

@brikis98
Copy link
Member

That's a good suggestion, but probably something we should do in a separate PR. In the meantime, the simple workaround is to git clone this repo into your GOPATH.

@davisford
Copy link
Contributor Author

davisford commented Mar 19, 2019

ml-dford:terraform-aws-couchbase dford$ pwd
/Users/dford/git/terraform-aws-couchbase
ml-dford:terraform-aws-couchbase dford$ ls
CODEOWNERS       LICENSE          README.md        examples/        modules/         test/
CONTRIBUTING.md  NOTICE           _docs/           main.tf          outputs.tf       variables.tf
ml-dford:terraform-aws-couchbase dford$ export GOPATH=$(pwd)
ml-dford:terraform-aws-couchbase dford$ echo $GOPATH
/Users/dford/git/terraform-aws-couchbase
ml-dford:terraform-aws-couchbase dford$ cd test
ml-dford:test dford$ dep ensure
root project import: /Users/dford/git/terraform-aws-couchbase/test is not within any GOPATH/src

nvm -- I had to just create a src dir above this one and set the $GOPATH up there.

@brikis98
Copy link
Member

nvm -- I had to just create a src dir above this one and set the $GOPATH up there.

Yea, exactly... GOTPATH is quite confusing/frustrating.

@davisford
Copy link
Contributor Author

I tried running a single cluster test. I succeeded in creating the cluster and seemed to be happy doing its testing, but then it tried to read SYSLOG and timed out.

It seems unlikely this is related to the changes in the PR, but do you have any suggestions?

TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:38-04:00 terratest_helpers.go:63: Making an HTTP POST call to URL http://admin:password@single-cluster-xtxbww-625366117.eu-west-3.elb.amazonaws.com:8091/pools/default/buckets/testwjkojZ/docs/test-key-wjkojZ with body map[value:[{"foo":"test-value-wjkojZ","bar":42}]]
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:38-04:00 couchbase_helpers.go:218: Successfully wrote (test-key-wjkojZ, TestData{Foo: 'test-value-wjkojZ', Bar: 42}) to bucket testwjkojZ
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:38-04:00 couchbase_helpers.go:233: Reading key test-key-wjkojZ from bucket testwjkojZ
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:38-04:00 retry.go:67: Reading key test-key-wjkojZ from bucket testwjkojZ
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:38-04:00 http_helper.go:26: Making an HTTP GET call to URL http://admin:password@single-cluster-xtxbww-625366117.eu-west-3.elb.amazonaws.com:8091/pools/default/buckets/testwjkojZ/docs/test-key-wjkojZ
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:38-04:00 couchbase_helpers.go:253: Got back {{test-key-wjkojZ 1-158d64620b6700000000000002000006 0 33554438} TestData{Foo: 'test-value-wjkojZ', Bar: 42}} for key test-key-wjkojZ from bucket testwjkojZ
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:38-04:00 retry.go:67: HTTP GET to URL http://single-cluster-xtxbww-625366117.eu-west-3.elb.amazonaws.com:4984/single-cluster-xtxbww
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:38-04:00 http_helper.go:26: Making an HTTP GET call to URL http://single-cluster-xtxbww-625366117.eu-west-3.elb.amazonaws.com:4984/single-cluster-xtxbww
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:39-04:00 test_structure.go:21: The 'SKIP_logs' environment variable is not set, so executing stage 'logs'.
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:39-04:00 save_test_data.go:159: Loading test data from /var/folders/lt/x7mcb69x6fs1cx3762hkm5vr0000gp/T/TestIntegrationCouchbaseCommunitySingleClusterUbuntu123967493/terraform-aws-couchbase/.test-data/TerraformOptions.json
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:39-04:00 save_test_data.go:159: Loading test data from /var/folders/lt/x7mcb69x6fs1cx3762hkm5vr0000gp/T/TestIntegrationCouchbaseCommunitySingleClusterUbuntu123967493/terraform-aws-couchbase/.test-data/AwsRegion.json
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:39-04:00 ec2-syslog.go:84: Fetching syslog for each Instance in ASG single-cluster-xtxbww in eu-west-3
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:39-04:00 ec2-syslog.go:32: Fetching syslog for Instance i-0b4de39db00ccdb36 in eu-west-3
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:39-04:00 retry.go:67: Fetching syslog for Instance i-0b4de39db00ccdb36 in eu-west-3
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:40-04:00 retry.go:79: Fetching syslog for Instance i-0b4de39db00ccdb36 in eu-west-3 returned an error: Syslog is not yet available for instance i-0b4de39db00ccdb36 in eu-west-3. Sleeping for 5s and will try again.
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:45-04:00 retry.go:67: Fetching syslog for Instance i-0b4de39db00ccdb36 in eu-west-3

@davisford
Copy link
Contributor Author

Also, if the test fail -- at least b/c of a timeout, it appears to just terminate, which means you're left to go manually clean up (or figure out how to terraform apply a fix). Might be good to also add this to the docs?

@brikis98
Copy link
Member

All the tests clean up after themselves, even if they fail. By "timeout" do you mean the Golang test timeout of 10 minutes? If so, that's an infuriating feature of Go where, by default, they unceremoniously kill off tests (via panic, so cleanup code can't run) that take longer than 10 minutes. That's why our docs always use the -timeout param to set a longer timeout; that way, the tests run to completion, including the clean up code.

@davisford
Copy link
Contributor Author

Do you know why the test failed to read SYSLOG?

TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:39-04:00 ec2-syslog.go:32: Fetching syslog for Instance i-0b4de39db00ccdb36 in eu-west-3
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:39-04:00 retry.go:67: Fetching syslog for Instance i-0b4de39db00ccdb36 in eu-west-3
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:40-04:00 retry.go:79: Fetching syslog for Instance i-0b4de39db00ccdb36 in eu-west-3 returned an error: Syslog is not yet available for instance i-0b4de39db00ccdb36 in eu-west-3. Sleeping for 5s and will try again.
TestIntegrationCouchbaseCommunitySingleClusterUbuntu 2019-03-19T11:03:45-04:00 retry.go:67: Fetching syslog for Instance i-0b4de39db00ccdb36 in eu-west-3

It kept retrying until eventually 10m timed out -- is this expected?

@brikis98
Copy link
Member

Syslog takes several minutes to be available. It should keep retrying if you let the test run longer than 10m!

@davisford
Copy link
Contributor Author

old PR

@davisford davisford closed this Feb 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants