Merge pull request #49 from marcosnils/container_services
Container services
This commit is contained in:
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestReadsMetricsFromKafka(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping integration test in short mode")
|
||||
}
|
||||
var zkPeers, brokerPeers []string
|
||||
|
||||
if len(os.Getenv("ZOOKEEPER_PEERS")) == 0 {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
func TestMemcachedGeneratesMetrics(t *testing.T) {
|
||||
m := &Memcached{
|
||||
Servers: []string{"localhost"},
|
||||
Servers: []string{testutil.GetLocalHost()},
|
||||
}
|
||||
|
||||
var acc testutil.Accumulator
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mysql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
|
||||
func TestMysqlGeneratesMetrics(t *testing.T) {
|
||||
m := &Mysql{
|
||||
Servers: []string{""},
|
||||
Servers: []string{fmt.Sprintf("root@tcp(%s:3306)/", testutil.GetLocalHost())},
|
||||
}
|
||||
|
||||
var acc testutil.Accumulator
|
||||
@@ -53,7 +54,9 @@ func TestMysqlGeneratesMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMysqlDefaultsToLocal(t *testing.T) {
|
||||
m := &Mysql{}
|
||||
m := &Mysql{
|
||||
Servers: []string{fmt.Sprintf("root@tcp(%s:3306)/", testutil.GetLocalHost())},
|
||||
}
|
||||
|
||||
var acc testutil.Accumulator
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package postgresql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/influxdb/telegraf/testutil"
|
||||
@@ -12,7 +13,7 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) {
|
||||
p := &Postgresql{
|
||||
Servers: []*Server{
|
||||
{
|
||||
Address: "sslmode=disable",
|
||||
Address: fmt.Sprintf("host=%s user=postgres sslmode=disable", testutil.GetLocalHost()),
|
||||
Databases: []string{"postgres"},
|
||||
},
|
||||
},
|
||||
@@ -57,7 +58,7 @@ func TestPostgresqlTagsMetricsWithDatabaseName(t *testing.T) {
|
||||
p := &Postgresql{
|
||||
Servers: []*Server{
|
||||
{
|
||||
Address: "sslmode=disable",
|
||||
Address: fmt.Sprintf("host=%s user=postgres sslmode=disable", testutil.GetLocalHost()),
|
||||
Databases: []string{"postgres"},
|
||||
},
|
||||
},
|
||||
@@ -78,7 +79,7 @@ func TestPostgresqlDefaultsToAllDatabases(t *testing.T) {
|
||||
p := &Postgresql{
|
||||
Servers: []*Server{
|
||||
{
|
||||
Address: "sslmode=disable",
|
||||
Address: fmt.Sprintf("host=%s user=postgres sslmode=disable", testutil.GetLocalHost()),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ func TestRedisGeneratesMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range checkInt {
|
||||
assert.NoError(t, acc.ValidateValue(c.name, c.value))
|
||||
assert.True(t, acc.CheckValue(c.name, c.value))
|
||||
}
|
||||
|
||||
checkFloat := []struct {
|
||||
@@ -98,7 +98,7 @@ func TestRedisGeneratesMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range checkFloat {
|
||||
assert.NoError(t, acc.ValidateValue(c.name, c.value))
|
||||
assert.True(t, acc.CheckValue(c.name, c.value))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ func TestRedisCanPullStatsFromMultipleServers(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range checkInt {
|
||||
assert.NoError(t, acc.ValidateValue(c.name, c.value))
|
||||
assert.True(t, acc.CheckValue(c.name, c.value))
|
||||
}
|
||||
|
||||
checkFloat := []struct {
|
||||
@@ -189,7 +189,7 @@ func TestRedisCanPullStatsFromMultipleServers(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range checkFloat {
|
||||
assert.NoError(t, acc.ValidateValue(c.name, c.value))
|
||||
assert.True(t, acc.CheckValue(c.name, c.value))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user