@@ -16,8 +16,6 @@ export const test = base.extend<{ testEnvironment: LocalLambdaStack; lambdaClien
16
16
async ( { } , use ) => {
17
17
console . log ( '[testEnvironment fixture] Setting up AWS Lambda test infrastructure' ) ;
18
18
19
- console . log ( 'NODE_VERSION' , process . env . NODE_VERSION ) ;
20
-
21
19
execSync ( 'docker network prune -f' ) ;
22
20
execSync ( `docker network create --driver bridge ${ DOCKER_NETWORK_NAME } ` ) ;
23
21
@@ -31,25 +29,23 @@ export const test = base.extend<{ testEnvironment: LocalLambdaStack; lambdaClien
31
29
const debugLog = tmp . fileSync ( { prefix : 'sentry_aws_lambda_tests_sam_debug' , postfix : '.log' } ) ;
32
30
console . log ( `[test_environment fixture] Writing SAM debug log to: ${ debugLog . name } ` ) ;
33
31
34
- const args = [
35
- 'local' ,
36
- 'start-lambda' ,
37
- '--debug' ,
38
- '--template' ,
39
- SAM_TEMPLATE_FILE ,
40
- '--warm-containers' ,
41
- 'EAGER' ,
42
- '--docker-network' ,
43
- DOCKER_NETWORK_NAME ,
44
- ] ;
45
-
46
- if ( process . env . NODE_VERSION ) {
47
- args . push ( '--invoke-image' , `public.ecr.aws/sam/build-nodejs${ process . env . NODE_VERSION } .x:latest` ) ;
48
- }
49
-
50
- const samProcess = spawn ( 'sam' , args , {
51
- stdio : [ 'ignore' , debugLog . fd , debugLog . fd ] ,
52
- } ) ;
32
+ const process = spawn (
33
+ 'sam' ,
34
+ [
35
+ 'local' ,
36
+ 'start-lambda' ,
37
+ '--debug' ,
38
+ '--template' ,
39
+ SAM_TEMPLATE_FILE ,
40
+ '--warm-containers' ,
41
+ 'EAGER' ,
42
+ '--docker-network' ,
43
+ DOCKER_NETWORK_NAME ,
44
+ ] ,
45
+ {
46
+ stdio : [ 'ignore' , debugLog . fd , debugLog . fd ] ,
47
+ } ,
48
+ ) ;
53
49
54
50
try {
55
51
await LocalLambdaStack . waitForStack ( ) ;
@@ -58,12 +54,12 @@ export const test = base.extend<{ testEnvironment: LocalLambdaStack; lambdaClien
58
54
} finally {
59
55
console . log ( '[testEnvironment fixture] Tearing down AWS Lambda test infrastructure' ) ;
60
56
61
- samProcess . kill ( 'SIGTERM' ) ;
57
+ process . kill ( 'SIGTERM' ) ;
62
58
await new Promise ( resolve => {
63
- samProcess . once ( 'exit' , resolve ) ;
59
+ process . once ( 'exit' , resolve ) ;
64
60
setTimeout ( ( ) => {
65
- if ( ! samProcess . killed ) {
66
- samProcess . kill ( 'SIGKILL' ) ;
61
+ if ( ! process . killed ) {
62
+ process . kill ( 'SIGKILL' ) ;
67
63
}
68
64
resolve ( void 0 ) ;
69
65
} , 5000 ) ;
0 commit comments