Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Script to pull the correct SAM docker image based on the NODE_VERSION environment variable.
# Script to pull the correct Lambda docker image based on the NODE_VERSION environment variable.

set -e

Expand All @@ -9,7 +9,7 @@ if [[ -z "$NODE_VERSION" ]]; then
exit 1
fi

echo "Pulling SAM Node $NODE_VERSION docker image..."
docker pull "public.ecr.aws/sam/build-nodejs${NODE_VERSION}.x:latest"
echo "Pulling Lambda Node $NODE_VERSION docker image..."
docker pull "public.ecr.aws/lambda/nodejs:${NODE_VERSION}"

echo "Successfully pulled SAM Node $NODE_VERSION docker image"
echo "Successfully pulled Lambda Node $NODE_VERSION docker image"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export const test = base.extend<{ testEnvironment: LocalLambdaStack; lambdaClien
writeFileSync(SAM_TEMPLATE_FILE, JSON.stringify(template, null, 2));

const debugLog = tmp.fileSync({ prefix: 'sentry_aws_lambda_tests_sam_debug', postfix: '.log' });
console.log(`[test_environment fixture] Writing SAM debug log to: ${debugLog.name}`);
if (!process.env.CI) {
console.log(`[test_environment fixture] Writing SAM debug log to: ${debugLog.name}`);
}

const args = [
'local',
Expand All @@ -39,16 +41,17 @@ export const test = base.extend<{ testEnvironment: LocalLambdaStack; lambdaClien
'EAGER',
'--docker-network',
DOCKER_NETWORK_NAME,
'--skip-pull-image',
];

if (process.env.NODE_VERSION) {
args.push('--invoke-image', `public.ecr.aws/sam/build-nodejs${process.env.NODE_VERSION}.x:latest`);
args.push('--invoke-image', `public.ecr.aws/lambda/nodejs:${process.env.NODE_VERSION}`);
}

console.log(`[testEnvironment fixture] Running SAM with args: ${args.join(' ')}`);

const samProcess = spawn('sam', args, {
stdio: ['ignore', debugLog.fd, debugLog.fd],
stdio: process.env.CI ? 'inherit' : ['ignore', debugLog.fd, debugLog.fd],
});

try {
Expand Down
Loading