Improve test infrastructure

This commit is contained in:
Brian Brazil
2015-06-20 13:32:32 +01:00
committed by Brian Brazil
parent 86a6f337f6
commit e34c52402f
4 changed files with 16 additions and 17 deletions

View File

@@ -39,7 +39,7 @@ func TestMysqlGeneratesMetrics(t *testing.T) {
var count int
for _, p := range acc.Points {
if strings.HasPrefix(p.Name, prefix.prefix) {
if strings.HasPrefix(p.Measurement, prefix.prefix) {
count++
}
}

View File

@@ -91,7 +91,7 @@ func TestPostgresqlDefaultsToAllDatabases(t *testing.T) {
var found bool
for _, pnt := range acc.Points {
if pnt.Name == "xact_commit" {
if pnt.Measurement == "xact_commit" {
if pnt.Tags["db"] == "postgres" {
found = true
break

View File

@@ -272,7 +272,9 @@ func TestSystemStats_GenerateStats(t *testing.T) {
require.NoError(t, err)
dockertags := map[string]string{
"id": "blah",
"name": "blah",
"id": "",
"command": "",
}
assert.True(t, acc.CheckTaggedValue("user", 3.1, dockertags))