Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Updated travis config to use botm master and cluster-resize Pilosa
Browse files Browse the repository at this point in the history
  • Loading branch information
yuce committed Feb 22, 2018
1 parent 5a69cc6 commit d7321cd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
31 changes: 26 additions & 5 deletions client_it_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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")
Expand Down

0 comments on commit d7321cd

Please sign in to comment.