@@ -31,6 +31,8 @@ import {
3131const ORIGINAL_ENV = {
3232 DATABASE_URL : process . env . DATABASE_URL ,
3333 DATABASE_URL_WEB : process . env . DATABASE_URL_WEB ,
34+ REDIS_TLS_SERVERNAME : process . env . REDIS_TLS_SERVERNAME ,
35+ REDIS_URL : process . env . REDIS_URL ,
3436 SIM_ENV_SECRET_ID : process . env . SIM_ENV_SECRET_ID ,
3537}
3638
@@ -75,30 +77,40 @@ describe('backfillTableWorkflowDeployments', () => {
7577 afterEach ( ( ) => {
7678 restoreEnvironmentVariable ( 'DATABASE_URL' )
7779 restoreEnvironmentVariable ( 'DATABASE_URL_WEB' )
80+ restoreEnvironmentVariable ( 'REDIS_TLS_SERVERNAME' )
81+ restoreEnvironmentVariable ( 'REDIS_URL' )
7882 restoreEnvironmentVariable ( 'SIM_ENV_SECRET_ID' )
7983 } )
8084
8185 it ( 'loads the staging runtime secret before database modules are needed' , async ( ) => {
8286 Reflect . deleteProperty ( process . env , 'DATABASE_URL' )
8387 Reflect . deleteProperty ( process . env , 'DATABASE_URL_WEB' )
88+ Reflect . deleteProperty ( process . env , 'REDIS_TLS_SERVERNAME' )
89+ Reflect . deleteProperty ( process . env , 'REDIS_URL' )
8490 Reflect . deleteProperty ( process . env , 'SIM_ENV_SECRET_ID' )
8591 mockLoadRuntimeSecrets . mockImplementation ( async ( ) => {
8692 process . env . DATABASE_URL = 'postgres://staging/database'
93+ process . env . REDIS_TLS_SERVERNAME = 'cache.staging.internal'
94+ process . env . REDIS_URL = 'rediss://cache.staging.internal:6379'
8795 } )
8896
8997 await prepareTableWorkflowDeploymentBackfillEnvironment ( [ '--environment=staging' ] )
9098
9199 expect ( process . env . SIM_ENV_SECRET_ID ) . toBe ( '/staging/sim/env-vars' )
100+ expect ( process . env . REDIS_TLS_SERVERNAME ) . toBeUndefined ( )
101+ expect ( process . env . REDIS_URL ) . toBeUndefined ( )
92102 expect ( mockLoadRuntimeSecrets ) . toHaveBeenCalledTimes ( 1 )
93103 } )
94104
95105 it ( 'keeps the existing local DATABASE_URL mode when no environment is requested' , async ( ) => {
96106 process . env . DATABASE_URL = 'postgres://local/database'
107+ process . env . REDIS_URL = 'redis://localhost:6379'
97108
98109 await prepareTableWorkflowDeploymentBackfillEnvironment ( [ ] )
99110
100111 expect ( mockLoadRuntimeSecrets ) . not . toHaveBeenCalled ( )
101112 expect ( process . env . DATABASE_URL ) . toBe ( 'postgres://local/database' )
113+ expect ( process . env . REDIS_URL ) . toBe ( 'redis://localhost:6379' )
102114 } )
103115
104116 it ( 'rejects unsupported, unknown, duplicate, and locally configured staging arguments' , async ( ) => {
0 commit comments