Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
machine:
pre:
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
services:
- docker

dependencies:
pre:
- sudo pip install docker-compose
- docker-compose -f docker-compose-integration.yml up -d --force-recreate

test:
override:
- go test -v -race -tags integration ./...:
environment:
ETCD_ADDR: http://localhost:2379
CONSUL_ADDR: localhost:8500
ZK_ADDR: localhost:2181
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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! ;)

16 changes: 16 additions & 0 deletions docker-compose-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '2'
services:
etcd:
image: quay.io/coreos/etcd
ports:
- "2379:2379"
command: /usr/local/bin/etcd -advertise-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 -listen-client-urls "http://0.0.0.0:2379,http://0.0.0.0:4001"
consul:
image: progrium/consul
ports:
- "8500:8500"
command: -server -bootstrap
zk:
image: zookeeper
ports:
- "2181:2181"
6 changes: 2 additions & 4 deletions sd/consul/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ import (
)

func TestIntegration(t *testing.T) {
// Connect to Consul.
// docker run -p 8500:8500 progrium/consul -server -bootstrap
consulAddr := os.Getenv("CONSUL_ADDRESS")
consulAddr := os.Getenv("CONSUL_ADDR")
if consulAddr == "" {
t.Fatal("CONSUL_ADDRESS is not set")
t.Fatal("CONSUL_ADDR is not set")
}
stdClient, err := stdconsul.NewClient(&stdconsul.Config{
Address: consulAddr,
Expand Down
21 changes: 5 additions & 16 deletions sd/zk/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ package zk

import (
"bytes"
"flag"
"fmt"
"log"
"os"
"testing"
"time"
Expand All @@ -18,21 +17,11 @@ var (
)

func TestMain(m *testing.M) {
flag.Parse()

fmt.Println("Starting ZooKeeper server...")

ts, err := stdzk.StartTestCluster(1, nil, nil)
if err != nil {
fmt.Printf("ZooKeeper server error: %v\n", err)
os.Exit(1)
zkAddr := os.Getenv("ZK_ADDR")
if zkAddr == "" {
log.Fatal("ZK_ADDR is not set")
}

host = []string{fmt.Sprintf("localhost:%d", ts.Servers[0].Port)}
code := m.Run()

ts.Stop()
os.Exit(code)
host = []string{zkAddr}
}

func TestCreateParentNodesOnServer(t *testing.T) {
Expand Down