Skip to content
Snippets Groups Projects
Commit 063718fa authored by Oliver's avatar Oliver
Browse files

omg

parent 293a3b73
No related branches found
No related tags found
No related merge requests found
Loading
@@ -46,7 +46,7 @@ steps:
Loading
@@ -46,7 +46,7 @@ steps:
- 'echo " ! gofmt -d exporter/*.go 2>&1 | read " | bash' - 'echo " ! gofmt -d exporter/*.go 2>&1 | read " | bash'
- 'go vet ./exporter/...' - 'go vet ./exporter/...'
- 'go build' - 'go build'
- "sleep 2" - "sleep 10" # let redis test instances all come up
- 'go test -v -covermode=atomic -cover -race -coverprofile=coverage.txt ./exporter/... --redis.addr=redis' - 'go test -v -covermode=atomic -cover -race -coverprofile=coverage.txt ./exporter/... --redis.addr=redis'
- 'go get github.com/mattn/goveralls' - 'go get github.com/mattn/goveralls'
- '/go/bin/goveralls -coverprofile=coverage.txt -service=drone.io' - '/go/bin/goveralls -coverprofile=coverage.txt -service=drone.io'
Loading
Loading
Loading
@@ -1265,7 +1265,10 @@ func TestClusterMaster(t *testing.T) {
Loading
@@ -1265,7 +1265,10 @@ func TestClusterMaster(t *testing.T) {
   
body := downloadUrl(t, ts.URL+"/metrics") body := downloadUrl(t, ts.URL+"/metrics")
log.Printf("master - body: %s", body) log.Printf("master - body: %s", body)
for _, want := range []string{"test_instance_info", "test_master_repl_offset", "test_master_last_io_seconds"} { for _, want := range []string{
"test_instance_info{addr=\"redis://redis-cluster:7000\",alias=\"master\",os=\"Linux 4.15.0-20-generic x86_64\",redis_build_id=\"1190d92ebdd7cbcf\",redis_mode=\"cluster\",redis_version=\"5.0.3\",role=\"master\"}",
"test_master_repl_offset",
} {
if !strings.Contains(body, want) { if !strings.Contains(body, want) {
t.Errorf("Did not find key [%s] \nbody: %s", want, body) t.Errorf("Did not find key [%s] \nbody: %s", want, body)
} }
Loading
@@ -1404,7 +1407,11 @@ func TestClusterSlave(t *testing.T) {
Loading
@@ -1404,7 +1407,11 @@ func TestClusterSlave(t *testing.T) {
   
body := downloadUrl(t, ts.URL+"/metrics") body := downloadUrl(t, ts.URL+"/metrics")
log.Printf("slave - body: %s", body) log.Printf("slave - body: %s", body)
for _, want := range []string{"test_instance_info", "test_slave_info"} { for _, want := range []string{
"test_instance_info",
"test_master_last_io_seconds",
"test_slave_info{addr=\"redis://redis-cluster:7005\",alias=\"slave\",master_host=\"172.30.0.4\",master_port=\"7002\",read_only=\"1\"}",
} {
if !strings.Contains(body, want) { if !strings.Contains(body, want) {
t.Errorf("Did not find key [%s] \nbody: %s", want, body) t.Errorf("Did not find key [%s] \nbody: %s", want, body)
} }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment