Skip to content

Commit

Permalink
fix postgres test after upgrading pgx
Browse files Browse the repository at this point in the history
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 jackc/pgx#343
  • Loading branch information
felixge committed Oct 23, 2017
1 parent 0615712 commit 34e53d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions plugins/inputs/postgresql/postgresql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -66,7 +66,6 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) {

stringMetrics := []string{
"datname",
"datid",
}

metricsCounted := 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,19 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) {
"temp_files",
"temp_bytes",
"deadlocks",
}

int32Metrics := []string{
"numbackends",
"datid",
}

int32Metrics := []string{}

floatMetrics := []string{
"blk_read_time",
"blk_write_time",
}

stringMetrics := []string{
"datname",
"datid",
}

metricsCounted := 0
Expand Down Expand Up @@ -175,20 +174,19 @@ func TestPostgresqlFieldOutput(t *testing.T) {
"temp_files",
"temp_bytes",
"deadlocks",
}

int32Metrics := []string{
"numbackends",
"datid",
}

int32Metrics := []string{}

floatMetrics := []string{
"blk_read_time",
"blk_write_time",
}

stringMetrics := []string{
"datname",
"datid",
}

for _, field := range intMetrics {
Expand Down

0 comments on commit 34e53d9

Please sign in to comment.