Skip to content

Commit 8ee96b2

Browse files
author
Andrew Rodriguez
committed
Merge branch 'main' of github.com:DataDog/datadog-lambda-extension
2 parents 22163f6 + 0a5a998 commit 8ee96b2

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

local_tests/build-docker-runtime.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ fi
1919
case "$RUNTIME" in
2020
python)
2121
if [ "$ARCHITECTURE" == "amd64" ]; then
22-
LAYER_NAME=Datadog-Python39-ARM
23-
else
2422
LAYER_NAME=Datadog-Python39
23+
else
24+
LAYER_NAME=Datadog-Python39-ARM
2525
fi
2626
DOCKERFILE=Dockerfile.Python
2727
;;
@@ -47,6 +47,7 @@ CURRENT_PATH=$(pwd)
4747
# Build the extension
4848
ARCHITECTURE=$ARCHITECTURE VERSION=1 ./scripts/build_binary_and_layer_dockerized.sh
4949

50+
5051
# Move to the local_tests repo
5152
cd ./local_tests
5253

@@ -55,7 +56,13 @@ cp ../.layers/datadog_extension-$ARCHITECTURE/extensions/datadog-agent .
5556

5657
# Build the recorder extension which will act as a man-in-a-middle to intercept payloads sent to Datadog
5758
cd ../../datadog-agent/test/integration/serverless/recorder-extension
58-
GOOS=linux GOARCH=$ARCHITECTURE go build -o "$CURRENT_PATH/local_tests/recorder-extension" main.go
59+
60+
if [ `uname -o` == "GNU/Linux" ]; then
61+
CGO_ENABLED=0 GOOS=linux GOARCH=$ARCHITECTURE go build -o "$CURRENT_PATH/local_tests/recorder-extension" main.go
62+
else
63+
GOOS=linux GOARCH=$ARCHITECTURE go build -o "$CURRENT_PATH/local_tests/recorder-extension" main.go
64+
fi
65+
5966
cd "$CURRENT_PATH/local_tests"
6067
if [ -z "$LAYER_PATH" ] && [ -n "$LAYER_NAME" ]; then
6168
# Get the latest available version
@@ -73,7 +80,7 @@ if [ -z "$LAYER_PATH" ] && [ -n "$LAYER_NAME" ]; then
7380
URL=$(aws-vault exec serverless-sandbox-account-admin \
7481
-- aws lambda get-layer-version --layer-name $LAYER_NAME --version-number $LATEST_AVAILABLE_VERSION \
7582
--query Content.Location --region sa-east-1 --output text)
76-
curl $URL -o "$LAYER"
83+
curl -k $URL -o "$LAYER"
7784
rm -rf $CURRENT_PATH/local_tests/META_INF
7885
rm -rf $CURRENT_PATH/local_tests/python
7986
unzip "$LAYER"

local_tests/invoke.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
NB_INVOKE=$1
44

55
# Start the container
6-
dockerId=$(docker run -d -p 9000:8080 -p 8124:8124 datadog/extension-local-tests)
6+
dockerId=$(docker run -d -p 9000:8080 -p 127.0.0.1:8124:8124 datadog/extension-local-tests)
77

88
# Curl it!
99
i=0
@@ -19,7 +19,7 @@ while true; do
1919
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ; echo
2020
fi
2121
sleep 1
22-
if [[ $i -gt $NB_INVOKE ]]
22+
if [[ $i -ge $NB_INVOKE ]]
2323
then
2424
echo "Saving logs to logs.txt"
2525
docker logs $dockerId >./local_tests/logs.txt 2>&1

0 commit comments

Comments
 (0)