Skip to content

Commit 54797f7

Browse files
committed
improvement: introduce fallback for docker secrets
1 parent 7b044bc commit 54797f7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/client_integration_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ func TestSimulationMode(t *testing.T) {
2424
// Because config.go looks in "./docker/...", which fails from the "tests" folder.
2525
if os.Getenv("TOKEN_ENCRYPTION_KEY") == "" {
2626
keyPath := "../docker/secrets/.crypto_key"
27+
28+
if _, err := os.Stat(keyPath); os.IsNotExist(err) {
29+
keyPath = "./docker/secrets/.crypto_key" // Fallback for nested tests
30+
}
31+
2732
key, err := os.ReadFile(keyPath)
2833
if err != nil {
2934
t.Logf("⚠️ Could not find secret at %s, and .env failed.", keyPath)

0 commit comments

Comments
 (0)