File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
integration-tests/serverless Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -11,30 +11,33 @@ ls "${SERVERLESS_INTEGRATION_DIR_PATH}/test-project/"
11
11
STAGE=$( xxd -l 4 -c 4 -p < /dev/random)
12
12
13
13
function cleanup {
14
- gcloud functions delete dd-trace-js-sls-mini-agent-integration-test-${STAGE} --region us-east1 --gen2 --quiet
14
+ gcloud functions delete dd-trace-js-sls-mini-agent-integration-test-${STAGE} --region us-east1 --gen2 --quiet --project datadog-sandbox
15
15
}
16
16
trap cleanup EXIT
17
17
18
18
echo " Deploying integration test cloud function"
19
19
20
- gcloud functions deploy dd-trace-js-sls-mini-agent-integration-test-${STAGE} \
20
+ DEPLOY_OUTPUT= $( gcloud functions deploy dd-trace-js-sls-mini-agent-integration-test-${STAGE} \
21
21
--gen2 \
22
22
--runtime=nodejs18 \
23
23
--region=us-east1 \
24
+ --project=datadog-sandbox \
24
25
--source " ${SERVERLESS_INTEGRATION_DIR_PATH} /test-project/" \
25
26
--entry-point=helloGET \
26
27
--trigger-http \
27
28
--allow-unauthenticated \
28
- --env-vars-file " ${SERVERLESS_INTEGRATION_DIR_PATH} /test-project/.env.yaml"
29
+ --env-vars-file " ${SERVERLESS_INTEGRATION_DIR_PATH} /test-project/.env.yaml" )
30
+
31
+ INVOKE_URL=$( echo " $DEPLOY_OUTPUT " | awk ' END {print $NF}' )
29
32
30
33
echo " Calling deployed cloud function"
31
34
32
- curl -s " https://us-east1-datadog-sandbox.cloudfunctions.net/dd-trace-js-sls-mini-agent-integration-test- ${STAGE }"
35
+ curl -s " ${INVOKE_URL }"
33
36
34
- echo " Waiting 1 minute before tailing logs"
37
+ echo " Waiting 60 seconds before tailing logs"
35
38
sleep 60
36
39
37
- LOGS=$( gcloud functions logs read dd-trace-js-sls-mini-agent-integration-test-${STAGE} --region us-east1 --gen2 --limit 1000)
40
+ LOGS=$( gcloud functions logs read dd-trace-js-sls-mini-agent-integration-test-${STAGE} --region us-east1 --gen2 --limit 1000 --project datadog-sandbox )
38
41
39
42
echo " $LOGS "
40
43
You can’t perform that action at this time.
0 commit comments