From 34e53d93fff4ea0745ec51046fc53142c6251c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Geisend=C3=B6rfer?= Date: Mon, 23 Oct 2017 16:14:47 +0200 Subject: [PATCH] fix postgres test after upgrading pgx pgx has made some changes when it comes to scanning row values into interface{} values. Those required some small adjustments to the types expected by the tests. see https://github.com/jackc/pgx/issues/343 --- plugins/inputs/postgresql/postgresql_test.go | 7 +++---- .../postgresql_extensible_test.go | 14 ++++++-------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/plugins/inputs/postgresql/postgresql_test.go b/plugins/inputs/postgresql/postgresql_test.go index 03c09936dbf57..410b9b4214c8d 100644 --- a/plugins/inputs/postgresql/postgresql_test.go +++ b/plugins/inputs/postgresql/postgresql_test.go @@ -51,12 +51,12 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) { "checkpoints_req", "checkpoints_timed", "maxwritten_clean", - } - - int32Metrics := []string{ + "datid", "numbackends", } + int32Metrics := []string{} + floatMetrics := []string{ "blk_read_time", "blk_write_time", @@ -66,7 +66,6 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) { stringMetrics := []string{ "datname", - "datid", } metricsCounted := 0 diff --git a/plugins/inputs/postgresql_extensible/postgresql_extensible_test.go b/plugins/inputs/postgresql_extensible/postgresql_extensible_test.go index 466cdfd98c9c1..4545a247800d3 100644 --- a/plugins/inputs/postgresql_extensible/postgresql_extensible_test.go +++ b/plugins/inputs/postgresql_extensible/postgresql_extensible_test.go @@ -53,12 +53,12 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) { "temp_files", "temp_bytes", "deadlocks", - } - - int32Metrics := []string{ "numbackends", + "datid", } + int32Metrics := []string{} + floatMetrics := []string{ "blk_read_time", "blk_write_time", @@ -66,7 +66,6 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) { stringMetrics := []string{ "datname", - "datid", } metricsCounted := 0 @@ -175,12 +174,12 @@ func TestPostgresqlFieldOutput(t *testing.T) { "temp_files", "temp_bytes", "deadlocks", - } - - int32Metrics := []string{ "numbackends", + "datid", } + int32Metrics := []string{} + floatMetrics := []string{ "blk_read_time", "blk_write_time", @@ -188,7 +187,6 @@ func TestPostgresqlFieldOutput(t *testing.T) { stringMetrics := []string{ "datname", - "datid", } for _, field := range intMetrics {