From 2de477ac40cc77de004ca42db6391d537208f3d9 Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Molins Date: Tue, 27 Aug 2024 17:44:52 +0200 Subject: [PATCH] Add tests --- .../install/application_configuration_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/internal/install/application_configuration_test.go b/internal/install/application_configuration_test.go index c52c471a1..5f20f3419 100644 --- a/internal/install/application_configuration_test.go +++ b/internal/install/application_configuration_test.go @@ -51,3 +51,22 @@ func TestSelectElasticAgentImageName_NextStackInOwnNamespace(t *testing.T) { selected := selectElasticAgentImageName(version) assert.Equal(t, selected, elasticAgentCompleteImageName) } + +func TestSelectElasticAgentImageName_WolfiImage(t *testing.T) { + version := "8.16.0-SNAPSHOT" + selected := selectElasticAgentImageName(version) + assert.Equal(t, selected, elasticAgentWolfiImageName) +} + +func TestSelectElasticAgentImageName_DisableWolfiImageEnvVar(t *testing.T) { + version := "8.16.0-SNAPSHOT" + t.Setenv(disableElasticAgentWolfiEnvVar, "true") + selected := selectElasticAgentImageName(version) + assert.Equal(t, selected, elasticAgentCompleteImageName) +} +func TestSelectElasticAgentImageName_EnableWolfiImageEnvVar(t *testing.T) { + version := "8.16.0-SNAPSHOT" + t.Setenv(disableElasticAgentWolfiEnvVar, "false") + selected := selectElasticAgentImageName(version) + assert.Equal(t, selected, elasticAgentWolfiImageName) +}