-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run integration tests on circleci #372
Conversation
@@ -1,4 +1,4 @@ | |||
// +build integration | |||
// +build integration-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just ignoring those tests for now, will remove that once everything is done.
pre: | ||
- sudo pip install docker-compose | ||
- docker-compose -f docker-compose-integration.yml up -d --force-recreate | ||
- mkdir -p ${HOME}/.go_workspace/src/github.com/go-kit/ && ln -sf ${HOME}/kit ${HOME}/.go_workspace/src/github.com/go-kit/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's probably not with go-kit/kit repo, but it's needed with mine. something related to internal packages.
- docker-compose -f docker-compose-integration.yml up -d --force-recreate | ||
- mkdir -p ${HOME}/.go_workspace/src/github.com/go-kit/ && ln -sf ${HOME}/kit ${HOME}/.go_workspace/src/github.com/go-kit/ | ||
override: | ||
- cd ${HOME}/.go_workspace/src/github.com/go-kit/kit && go get -t -d -v ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be sufficient to go get -d -t -v ./...
without the cd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, probably with go-kit/kit repo, not with my fork.
before sending the final PR I will remove all this workaround that I need to run builds on circle from my fork.
Ping? :) |
@peterbourgon sorry about the delay. so should I keep going with this one? |
No worries at all! Yes, please, if you can; otherwise I can take it over at some point. Thanks for the contribution :) |
Yes, I can and will be happy to help. Will try to finish this by the weekend. |
Friendly ping :) Any update here? |
I am being busy lately, will try to find some time to work on this in the next few days. |
1a92b06
to
306c92e
Compare
@peterbourgon done! the tests are failing now, probably because circleci is configured to use the old image (12.04) instead of the new one (14.04). If you change that, then the build should pass. Another solution is to stop zookeeper on circle.yml, I can do that if you prefer this solution. |
Well, the error is pretty explicit; the docker-compose up fails with
When I try to do the same thing locally, I get a similar error:
I think there must be some error in the way you've got the docker-compose file orchestrating things. Does this work for you locally? |
The error happens on circle ci, probably because it's running on 12.04 image which has the zookeeper up and running(https://circleci.com/docs/build-image-precise/#databases), conflicting the ports as the docker-compose is using default ports for every key store (consul, etcd and zk). I tested on circle ci using 14.04 (https://circleci.com/docs/build-image-trusty/#databases) which doesn't have a zookeeper running. On your machine you might have a etcd running which will also conflict the ports. Yes it works locally for me and when I run on circle ci from my repo. I can change to use random ports if you prefer. |
Ah, OK! Thanks for the more lengthy explanation. You're probably right; I was running that in a minikube (Kubernetes) VM which probably has etcd listening on the default port. I'll poke around a bit more. |
hey @peterbourgon any update on this? do you need some help? |
Thanks for the poke :) I got it working locally. A few changes I'd like to see to the PR itself incoming... |
environment: | ||
ETCD_ADDR: http://localhost:2379 | ||
CONSUL_ADDR: localhost:8500 | ||
ZK_ADDR: localhost:2181 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make whatever changes are necessary to get this working on Circle in the file, or do I need to change something in the repo settings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that it's better if you go to Circle repo settings and change the box image option from ubuntu 12.04 to 14.04.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Takes a fresh commit to test; we'll do it on master! ;)
if err != nil { | ||
fmt.Printf("ZooKeeper server error: %v\n", err) | ||
os.Exit(1) | ||
func init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this moved out of TestMain and into init?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the code that was starting zookeeper (this previously needed the zk jar file somewhere). Not really sure the difference of init and TestMain. Would you prefer to have this code on TestMain instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init is executed when the package is imported; TestMain is executed when the test driver starts. I like to avoid init whenever possible, so yes, please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, got it. Will do that later today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
306c92e
to
0ff31a2
Compare
Brilliant! Works locally and I'm happy with the delta. Thanks very much for the contribution! 👍 |
Run integration tests on circleci
This PR is to address the following issue: #328
This is still working in progress, I'd be happy to finish this if it's looking good.
There are some workarounds to fix the GOPATH in circle.yml, it might not be necessary on the original repo.