Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 006600e

Browse files
authored
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.
1 parent 0d8d5f2 commit 006600e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

enterprise/dbcrypt/cipher_internal_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ func TestCiphersBackwardCompatibility(t *testing.T) {
100100
// 3. Copy the value from the test output and do what you need with it.
101101
func TestHelpMeEncryptSomeValue(t *testing.T) {
102102
t.Parallel()
103-
t.Skip("this only exists if you need to encrypt a value with dbcrypt, it does not actually test anything")
104-
105103
valueToEncrypt := os.Getenv("ENCRYPT_ME")
104+
if valueToEncrypt == "" {
105+
t.Skip("Set ENCRYPT_ME to some value you need to encrypt")
106+
}
106107
t.Logf("valueToEncrypt: %q", valueToEncrypt)
107108
keys := os.Getenv("CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS")
108109
require.NotEmpty(t, keys, "Set the CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS environment variable to use this")

0 commit comments

Comments
 (0)