From 3b387489848254e4307ddd90540be97753ecf335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C4=8Ctvrtka?= Date: Wed, 4 Dec 2024 10:46:05 +0100 Subject: [PATCH] PMM-5086-12634 Fix another tests. --- managed/models/agent_model_test.go | 36 ++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/managed/models/agent_model_test.go b/managed/models/agent_model_test.go index 909d49b3aa..65f71d6ff0 100644 --- a/managed/models/agent_model_test.go +++ b/managed/models/agent_model_test.go @@ -288,10 +288,12 @@ func TestPostgresAgentTLS(t *testing.T) { func TestPostgresWithSocket(t *testing.T) { t.Run("empty-password", func(t *testing.T) { agent := &models.Agent{ - Username: pointer.ToString("username"), - AgentType: models.PostgresExporterType, - TLS: true, - TLSSkipVerify: false, + Username: pointer.ToString("username"), + AgentType: models.PostgresExporterType, + TLS: true, + TLSSkipVerify: false, + ExporterOptions: &models.ExporterOptions{}, + PostgreSQLOptions: &models.PostgreSQLOptions{}, } service := &models.Service{ Socket: pointer.ToString("/var/run/postgres"), @@ -302,7 +304,9 @@ func TestPostgresWithSocket(t *testing.T) { t.Run("empty-user-password", func(t *testing.T) { agent := &models.Agent{ - AgentType: models.PostgresExporterType, + AgentType: models.PostgresExporterType, + ExporterOptions: &models.ExporterOptions{}, + PostgreSQLOptions: &models.PostgreSQLOptions{}, } service := &models.Service{ Socket: pointer.ToString("/var/run/postgres"), @@ -313,7 +317,9 @@ func TestPostgresWithSocket(t *testing.T) { t.Run("dir-with-symbols", func(t *testing.T) { agent := &models.Agent{ - AgentType: models.PostgresExporterType, + AgentType: models.PostgresExporterType, + ExporterOptions: &models.ExporterOptions{}, + PostgreSQLOptions: &models.PostgreSQLOptions{}, } service := &models.Service{ Socket: pointer.ToString(`/tmp/123\ A0m\%\$\@\8\,\+\-`), @@ -326,10 +332,12 @@ func TestPostgresWithSocket(t *testing.T) { func TestMongoWithSocket(t *testing.T) { t.Run("empty-password", func(t *testing.T) { agent := &models.Agent{ - Username: pointer.ToString("username"), - AgentType: models.MongoDBExporterType, - TLS: true, - TLSSkipVerify: false, + Username: pointer.ToString("username"), + AgentType: models.MongoDBExporterType, + TLS: true, + TLSSkipVerify: false, + ExporterOptions: &models.ExporterOptions{}, + MongoDBOptions: &models.MongoDBOptions{}, } service := &models.Service{ Socket: pointer.ToString("/tmp/mongodb-27017.sock"), @@ -340,7 +348,9 @@ func TestMongoWithSocket(t *testing.T) { t.Run("empty-user-password", func(t *testing.T) { agent := &models.Agent{ - AgentType: models.MongoDBExporterType, + AgentType: models.MongoDBExporterType, + ExporterOptions: &models.ExporterOptions{}, + MongoDBOptions: &models.MongoDBOptions{}, } service := &models.Service{ Socket: pointer.ToString("/tmp/mongodb-27017.sock"), @@ -351,7 +361,9 @@ func TestMongoWithSocket(t *testing.T) { t.Run("dir-with-symbols", func(t *testing.T) { agent := &models.Agent{ - AgentType: models.MongoDBExporterType, + AgentType: models.MongoDBExporterType, + ExporterOptions: &models.ExporterOptions{}, + MongoDBOptions: &models.MongoDBOptions{}, } service := &models.Service{ Socket: pointer.ToString(`/tmp/123\ A0m\%\$\@\8\,\+\-/mongodb-27017.sock`),