File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313# which is why CI filters those with `find ... ! -name` instead.
1414preload = [
1515 " ../sdk/test/setup-env.ts" ,
16- " ../test/setup-scm-loader.ts" ,
1716 " ./test/setup-agents-artifact.ts" ,
1817]
Original file line number Diff line number Diff line change @@ -121,23 +121,30 @@ function loadCliEnv(): Record<string, string> {
121121
122122 try {
123123 ensureCliEnvDefaults ( )
124- // NOTE: Inline require() is used for lazy loading - the env module depends on
125- // Infisical secrets which may not be available at module load time in test environments
126- const { env } = require ( '../../../packages/internal/src/env' ) as {
127- env : Record < string , unknown >
128- }
124+ try {
125+ const { env } = require ( '../../../packages/internal/src/env' ) as {
126+ env : Record < string , unknown >
127+ }
129128
130- cachedEnv = Object . entries ( env ) . reduce < Record < string , string > > (
131- ( acc , [ key , value ] ) => {
132- if ( value !== undefined && value !== null ) {
133- acc [ key ] = String ( value )
134- }
135- return acc
136- } ,
137- { } ,
138- )
129+ cachedEnv = Object . entries ( env ) . reduce < Record < string , string > > (
130+ ( acc , [ key , value ] ) => {
131+ if ( value !== undefined && value !== null ) {
132+ acc [ key ] = String ( value )
133+ }
134+ return acc
135+ } ,
136+ { } ,
137+ )
139138
140- return cachedEnv
139+ return cachedEnv
140+ } catch {
141+ // Fallback for public mirror where packages/internal is not present
142+ cachedEnv = {
143+ ...TEST_CLIENT_ENV_DEFAULTS ,
144+ ...TEST_SERVER_ENV_DEFAULTS ,
145+ }
146+ return cachedEnv
147+ }
141148 } catch ( error ) {
142149 const message =
143150 error instanceof Error
You can’t perform that action at this time.
0 commit comments