Skip to content

Commit

Permalink
test(inputs/postgresql): Fixing integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
zak-pawel committed Oct 5, 2024
1 parent 40d7961 commit 60d5ef5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions plugins/inputs/postgresql/postgresql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,24 @@ func TestPostgresqlGeneratesMetricsIntegration(t *testing.T) {
"temp_bytes",
"deadlocks",
"buffers_alloc",
"buffers_backend",
"buffers_backend_fsync",
"buffers_checkpoint",
"buffers_clean",
"checkpoints_req",
"checkpoints_timed",
"maxwritten_clean",
"datid",
"numbackends",
"sessions",
"sessions_killed",
"sessions_fatal",
"sessions_abandoned",
}

int32Metrics := []string{}

floatMetrics := []string{
"blk_read_time",
"blk_write_time",
"checkpoint_write_time",
"checkpoint_sync_time",
"active_time",
"idle_in_transaction_time",
"session_time",
}

stringMetrics := []string{
Expand All @@ -106,22 +106,22 @@ func TestPostgresqlGeneratesMetricsIntegration(t *testing.T) {
metricsCounted := 0

for _, metric := range intMetrics {
require.True(t, acc.HasInt64Field("postgresql", metric))
require.True(t, acc.HasInt64Field("postgresql", metric), "%q not found in int metrics", metric)
metricsCounted++
}

for _, metric := range int32Metrics {
require.True(t, acc.HasInt32Field("postgresql", metric))
require.True(t, acc.HasInt32Field("postgresql", metric), "%q not found in int32 metrics", metric)
metricsCounted++
}

for _, metric := range floatMetrics {
require.True(t, acc.HasFloatField("postgresql", metric))
require.True(t, acc.HasFloatField("postgresql", metric), "%q not found in float metrics", metric)
metricsCounted++
}

for _, metric := range stringMetrics {
require.True(t, acc.HasStringField("postgresql", metric))
require.True(t, acc.HasStringField("postgresql", metric), "%q not found in string metrics", metric)
metricsCounted++
}

Expand Down

0 comments on commit 60d5ef5

Please sign in to comment.