From 006600ea3e605a527115ded005dc485cc601ff71 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Thu, 27 Mar 2025 09:45:34 +0000 Subject: [PATCH] chore(enterprise/dbcrypt): adjust behaviour of TestHelpMeEncryptSomeValue (#17116) This "utility test" isn't so useful if you have to uncomment the `t.Skip()` before using it. --- enterprise/dbcrypt/cipher_internal_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/enterprise/dbcrypt/cipher_internal_test.go b/enterprise/dbcrypt/cipher_internal_test.go index f3884df23f..ef9b7d6cd6 100644 --- a/enterprise/dbcrypt/cipher_internal_test.go +++ b/enterprise/dbcrypt/cipher_internal_test.go @@ -100,9 +100,10 @@ func TestCiphersBackwardCompatibility(t *testing.T) { // 3. Copy the value from the test output and do what you need with it. func TestHelpMeEncryptSomeValue(t *testing.T) { t.Parallel() - t.Skip("this only exists if you need to encrypt a value with dbcrypt, it does not actually test anything") - valueToEncrypt := os.Getenv("ENCRYPT_ME") + if valueToEncrypt == "" { + t.Skip("Set ENCRYPT_ME to some value you need to encrypt") + } t.Logf("valueToEncrypt: %q", valueToEncrypt) keys := os.Getenv("CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS") require.NotEmpty(t, keys, "Set the CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS environment variable to use this")