Skip to content

Commit

Permalink
[serverless] Improve integration tests UX, add ability to skip test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nhinsch authored Jan 31, 2022
1 parent 52cbbaa commit d5b8631
Show file tree
Hide file tree
Showing 31 changed files with 252 additions and 308 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/serverless-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
node-version: 14

- name: Install Serverless Framework
run: sudo yarn global add serverless --prefix /usr/local
run: sudo yarn global add serverless@^2.72.2 --prefix /usr/local

- name: Checkout the datadog-lambda-extension repository
uses: actions/checkout@v2
Expand All @@ -36,5 +36,5 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SERVERLESS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SERVERLESS_AWS_SECRET_ACCESS_KEY }}
run: BUILD_EXTENSION=true ./test/integration/serverless/run.sh
run: ./test/integration/serverless/run.sh
working-directory: go/src/github.com/DataDog/datadog-agent
6 changes: 1 addition & 5 deletions test/integration/serverless/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ recorder-extension/extensions
recorder-extension/ext.zip
src/csharp-tests/bin
src/csharp-tests/obj
src/java-tests/with-ddlambda/target
src/java-tests/trace/target
src/java-tests/log/target
src/java-tests/timeout/target
src/java-tests/error/target
src/java-tests/*/target
9 changes: 9 additions & 0 deletions test/integration/serverless/build_csharp_functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

echo "Building C# Lambda functions"
cd src/csharp-tests
dotnet restore --verbosity quiet
set +e #set this so we don't exit if the tools are already installed
dotnet tool install -g Amazon.Lambda.Tools --framework netcoreapp3.1 --verbosity quiet
set -e
dotnet lambda package --configuration Release --framework netcoreapp3.1 --verbosity quiet --output-package bin/Release/netcoreapp3.1/handler.zip
8 changes: 8 additions & 0 deletions test/integration/serverless/build_go_functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

echo "Building Go functions"
go_test_dirs=("metric" "log" "timeout" "trace")
cd src
for go_dir in "${go_test_dirs[@]}"; do
env GOOS=linux go build -ldflags="-s -w" -o bin/"$go_dir" go-tests/"$go_dir"/main.go
done
8 changes: 8 additions & 0 deletions test/integration/serverless/build_java_functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

echo "Building Java Lambda Functions"
java_test_dirs=("metric" "trace" "log" "timeout" "error")
cd src
for java_dir in "${java_test_dirs[@]}"; do
mvn package -q -f java-tests/"${java_dir}"/pom.xml
done
6 changes: 6 additions & 0 deletions test/integration/serverless/build_recorder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo "Building recorder extension"
cd recorder-extension
GOOS=linux GOARCH=amd64 go build -o extensions/recorder-extension main.go
zip -rq ext.zip extensions/* -x ".*" -x "__MACOSX" -x "extensions/.*"
Loading

0 comments on commit d5b8631

Please sign in to comment.