mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
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.
This commit is contained in:
@@ -100,9 +100,10 @@ func TestCiphersBackwardCompatibility(t *testing.T) {
|
|||||||
// 3. Copy the value from the test output and do what you need with it.
|
// 3. Copy the value from the test output and do what you need with it.
|
||||||
func TestHelpMeEncryptSomeValue(t *testing.T) {
|
func TestHelpMeEncryptSomeValue(t *testing.T) {
|
||||||
t.Parallel()
|
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")
|
valueToEncrypt := os.Getenv("ENCRYPT_ME")
|
||||||
|
if valueToEncrypt == "" {
|
||||||
|
t.Skip("Set ENCRYPT_ME to some value you need to encrypt")
|
||||||
|
}
|
||||||
t.Logf("valueToEncrypt: %q", valueToEncrypt)
|
t.Logf("valueToEncrypt: %q", valueToEncrypt)
|
||||||
keys := os.Getenv("CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS")
|
keys := os.Getenv("CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS")
|
||||||
require.NotEmpty(t, keys, "Set the CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS environment variable to use this")
|
require.NotEmpty(t, keys, "Set the CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS environment variable to use this")
|
||||||
|
|||||||
Reference in New Issue
Block a user