From ffd7fdefb1781ee074e55e1975c43bc728dfbb03 Mon Sep 17 00:00:00 2001 From: Yury Kovalev Date: Tue, 13 Jun 2023 15:04:43 +0200 Subject: [PATCH] Fix tests --- fleetshard/config/config_test.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/fleetshard/config/config_test.go b/fleetshard/config/config_test.go index 1e2c32f5fd..09b7ad3488 100644 --- a/fleetshard/config/config_test.go +++ b/fleetshard/config/config_test.go @@ -30,30 +30,17 @@ func TestSingleton_Failure(t *testing.T) { func TestSingleton_Success_WhenManagedDBEnabled(t *testing.T) { t.Setenv("CLUSTER_ID", "some-value") - t.Setenv("AWS_ROLE_ARN", "arn:aws:iam::012456789:role/fake_role") t.Setenv("MANAGED_DB_ENABLED", "true") t.Setenv("MANAGED_DB_SECURITY_GROUP", "some-group") cfg, err := GetConfig() require.NoError(t, err) - assert.Equal(t, cfg.AWS.RoleARN, "arn:aws:iam::012456789:role/fake_role") - assert.Equal(t, cfg.AWS.Region, "us-east-1") assert.Equal(t, cfg.ManagedDB.Enabled, true) assert.Equal(t, cfg.ManagedDB.SecurityGroup, "some-group") } -func TestSingleton_Failure_WhenManagedDBEnabledAndAWSRoleArnNotSet(t *testing.T) { - t.Setenv("CLUSTER_ID", "some-value") - t.Setenv("MANAGED_DB_ENABLED", "true") - t.Setenv("MANAGED_DB_SECURITY_GROUP", "some-group") - cfg, err := GetConfig() - assert.Error(t, err, "MANAGED_DB_ENABLED == true and AWS_ROLE_ARN unset in the environment") - assert.Nil(t, cfg) -} - func TestSingleton_Failure_WhenManagedDBEnabledAndManagedDbSecurityGroupNotSet(t *testing.T) { t.Setenv("CLUSTER_ID", "some-value") t.Setenv("MANAGED_DB_ENABLED", "true") - t.Setenv("AWS_ROLE_ARN", "arn:aws:iam::012456789:role/fake_role") cfg, err := GetConfig() assert.Error(t, err, "MANAGED_DB_ENABLED == true and MANAGED_DB_SECURITY_GROUP unset in the environment") assert.Nil(t, cfg)