From d7321cddb17c2a698671f82891ab92b76f69543c Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 22 Feb 2018 18:05:05 +0300 Subject: [PATCH] Updated travis config to use botm master and cluster-resize Pilosa --- .travis.yml | 10 +++++++--- client_it_test.go | 31 ++++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a114d81..4590fa7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,15 @@ before_install: - openssl req -x509 -newkey rsa:4096 -keyout test.pilosa.local.key -out test.pilosa.local.crt -days 3650 -nodes -subj "/C=US/ST=Texas/L=Austin/O=Pilosa/OU=Com/CN=test.pilosa.local" - wget https://s3.amazonaws.com/build.pilosa.com/pilosa-master-linux-amd64.tar.gz && tar xf pilosa-master-linux-amd64.tar.gz - ./pilosa-master-linux-amd64/pilosa server --metric.diagnostics=false -d http_data & - - ./pilosa-master-linux-amd64/pilosa server --metric.diagnostics=false -b https://:20101 -d https_data --tls.skip-verify --tls.certificate test.pilosa.local.crt --tls.key test.pilosa.local.key --cluster.type static & - go get github.com/mattn/goveralls - go get -u github.com/golang/dep/cmd/dep -addons: -script: - dep ensure +script: + - ./pilosa-master-linux-amd64/pilosa server --metric.diagnostics=false -b https://:20101 -d https_data --tls.skip-verify --tls.certificate test.pilosa.local.crt --tls.key test.pilosa.local.key --cluster.type static & - PILOSA_BIND="https://:20101" make test-all + - pkill pilosa + - ./pilosa-cluster-resize-linux-amd64/pilosa server --metric.diagnostics=false -b http://:30101 -d cluster_resize_data --cluster.disabled & + - PILOSA_BIND="http://:30101" LEGACY_MODE_OFF=true make test-all + - pkill pilosa + - ./pilosa-master-linux-amd64/pilosa server --metric.diagnostics=false -d http_data & - $HOME/gopath/bin/goveralls -service=travis-ci -ignore "gopilosa_pbuf/public.pb.go" -flags="-tags=integration fullcoverage" diff --git a/client_it_test.go b/client_it_test.go index d666683..22e2f72 100644 --- a/client_it_test.go +++ b/client_it_test.go @@ -1473,15 +1473,25 @@ func TestClientRace(t *testing.T) { } func getClient() *Client { + var client *Client + var err error uri, err := NewURIFromAddress(getPilosaBindAddress()) if err != nil { panic(err) } - client, err := NewClient(uri, - TLSConfig(&tls.Config{InsecureSkipVerify: true}), - // LegacyMode(true), - // SkipVersionCheck() - ) + + legacyModeOff := getLegacyModeOff() + if legacyModeOff { + client, err = NewClient(uri, + TLSConfig(&tls.Config{InsecureSkipVerify: true}), + LegacyMode(false), + SkipVersionCheck(), + ) + } else { + client, err = NewClient(uri, + TLSConfig(&tls.Config{InsecureSkipVerify: true}), + ) + } if err != nil { panic(err) } @@ -1498,6 +1508,17 @@ func getPilosaBindAddress() string { return "http://:10101" } +func getLegacyModeOff() bool { + for _, kvStr := range os.Environ() { + kv := strings.SplitN(kvStr, "=", 2) + if kv[0] == "LEGACY_MODE_OFF" { + return kv[1] == "true" + } + } + return false + +} + func getMockServer(statusCode int, response []byte, contentLength int) *httptest.Server { handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/x-protobuf")