Skip to content

Commit bf82854

Browse files
committed
Rename functions to format handler-name_runtime
1 parent 68f47ee commit bf82854

26 files changed

+26
-26
lines changed

scripts/run_integration_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ echo "Invoking functions"
5050
set +e # Don't immediately exit this script if an invocation fails or there's a diff
5151
for handler_name in "${LAMBDA_HANDLERS[@]}"; do
5252
for runtime in "${RUNTIMES[@]}"; do
53-
function_name="$handler_name-$runtime"
53+
function_name="${handler_name}_${runtime}"
5454
function_snapshot_path="./snapshots/$function_name.return_value"
5555

5656
return_value=$(serverless invoke -f $function_name)
@@ -81,7 +81,7 @@ sleep $LOGS_WAIT_SECONDS
8181
echo "Fetching logs for invocations and comparing to snapshots"
8282
for handler_name in "${LAMBDA_HANDLERS[@]}"; do
8383
for runtime in "${RUNTIMES[@]}"; do
84-
function_name="$handler_name-$runtime"
84+
function_name="${handler_name}_${runtime}"
8585
function_snapshot_path="./snapshots/$function_name.logs"
8686

8787
# Fetch logs with serverless cli

tests/integration/serverless.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@ layers:
2525

2626
functions:
2727
# async-metrics
28-
async-metrics-python27:
28+
async-metrics_python27:
2929
handler: handle.handle
3030
runtime: python2.7
3131
layers:
3232
- { Ref: Python27LambdaLayer }
3333
environment:
3434
DD_FLUSH_TO_LOG: true
3535

36-
async-metrics-python36:
36+
async-metrics_python36:
3737
handler: handle.handle
3838
runtime: python3.6
3939
layers:
4040
- { Ref: Python36LambdaLayer }
4141
environment:
4242
DD_FLUSH_TO_LOG: true
4343

44-
async-metrics-python37:
44+
async-metrics_python37:
4545
handler: handle.handle
4646
runtime: python3.7
4747
layers:
4848
- { Ref: Python37LambdaLayer }
4949
environment:
5050
DD_FLUSH_TO_LOG: true
5151

52-
async-metrics-python38:
52+
async-metrics_python38:
5353
handler: handle.handle
5454
runtime: python3.8
5555
layers:
@@ -58,50 +58,50 @@ functions:
5858
DD_FLUSH_TO_LOG: true
5959

6060
# sync-metrics
61-
sync-metrics-python27:
61+
sync-metrics_python27:
6262
handler: handle.handle
6363
runtime: python2.7
6464
layers:
6565
- { Ref: Python27LambdaLayer }
6666

67-
sync-metrics-python36:
67+
sync-metrics_python36:
6868
handler: handle.handle
6969
runtime: python3.6
7070
layers:
7171
- { Ref: Python36LambdaLayer }
7272

73-
sync-metrics-python37:
73+
sync-metrics_python37:
7474
handler: handle.handle
7575
runtime: python3.7
7676
layers:
7777
- { Ref: Python37LambdaLayer }
7878

79-
sync-metrics-python38:
79+
sync-metrics_python38:
8080
handler: handle.handle
8181
runtime: python3.8
8282
layers:
8383
- { Ref: Python38LambdaLayer }
8484

8585
# http-requests
86-
http-requests-python27:
86+
http-requests_python27:
8787
handler: http_requests.handle
8888
runtime: python2.7
8989
layers:
9090
- { Ref: Python27LambdaLayer }
9191

92-
http-requests-python36:
92+
http-requests_python36:
9393
handler: http_requests.handle
9494
runtime: python3.6
9595
layers:
9696
- { Ref: Python36LambdaLayer }
9797

98-
http-requests-python37:
98+
http-requests_python37:
9999
handler: http_requests.handle
100100
runtime: python3.7
101101
layers:
102102
- { Ref: Python37LambdaLayer }
103103

104-
http-requests-python38:
104+
http-requests_python38:
105105
handler: http_requests.handle
106106
runtime: python3.8
107107
layers:

tests/integration/snapshots/async-metrics-python27.logs renamed to tests/integration/snapshots/async-metrics_python27.logs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
START RequestId: XXXX Version: $LATEST
2-
{"e": XXXX, "m": "aws.lambda.enhanced.invocations", "t": ["region:us-east-1", "account_id:601427279990", "functionname:integration-tester-dev-async-metrics-python27", "cold_start:true", "memorysize:1024", "runtime:python2.7", "dd_lambda_layer:datadog-python27_2.13.0"], "v": 1}
2+
{"e": XXXX, "m": "aws.lambda.enhanced.invocations", "t": ["region:us-east-1", "account_id:601427279990", "functionname:integration-tester-dev-async-metrics_python27", "cold_start:true", "memorysize:1024", "runtime:python2.7", "dd_lambda_layer:datadog-python27_2.13.0"], "v": 1}
33
{"e": XXXX, "m": "hello.dog", "t": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python27_2.13.0"], "v": 1}
44
{"e": XXXX, "m": "tests.integration.count", "t": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python27_2.13.0"], "v": 21}
55
END RequestId: XXXX

tests/integration/snapshots/async-metrics-python27.return_value renamed to tests/integration/snapshots/async-metrics_python27.return_value

File renamed without changes.

tests/integration/snapshots/async-metrics-python36.logs renamed to tests/integration/snapshots/async-metrics_python36.logs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
START RequestId: XXXX Version: $LATEST
2-
{"m": "aws.lambda.enhanced.invocations", "v": 1, "e": XXXX, "t": ["region:us-east-1", "account_id:601427279990", "functionname:integration-tester-dev-async-metrics-python36", "cold_start:true", "memorysize:1024", "runtime:python3.6", "dd_lambda_layer:datadog-python36_2.13.0"]}
2+
{"m": "aws.lambda.enhanced.invocations", "v": 1, "e": XXXX, "t": ["region:us-east-1", "account_id:601427279990", "functionname:integration-tester-dev-async-metrics_python36", "cold_start:true", "memorysize:1024", "runtime:python3.6", "dd_lambda_layer:datadog-python36_2.13.0"]}
33
{"m": "hello.dog", "v": 1, "e": XXXX, "t": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python36_2.13.0"]}
44
{"m": "tests.integration.count", "v": 21, "e": XXXX, "t": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python36_2.13.0"]}
55
END RequestId: XXXX

tests/integration/snapshots/async-metrics-python36.return_value renamed to tests/integration/snapshots/async-metrics_python36.return_value

File renamed without changes.

tests/integration/snapshots/async-metrics-python37.logs renamed to tests/integration/snapshots/async-metrics_python37.logs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
START RequestId: XXXX Version: $LATEST
2-
{"m": "aws.lambda.enhanced.invocations", "v": 1, "e": XXXX, "t": ["region:us-east-1", "account_id:601427279990", "functionname:integration-tester-dev-async-metrics-python37", "cold_start:true", "memorysize:1024", "runtime:python3.7", "dd_lambda_layer:datadog-python37_2.13.0"]}
2+
{"m": "aws.lambda.enhanced.invocations", "v": 1, "e": XXXX, "t": ["region:us-east-1", "account_id:601427279990", "functionname:integration-tester-dev-async-metrics_python37", "cold_start:true", "memorysize:1024", "runtime:python3.7", "dd_lambda_layer:datadog-python37_2.13.0"]}
33
{"m": "hello.dog", "v": 1, "e": XXXX, "t": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_2.13.0"]}
44
{"m": "tests.integration.count", "v": 21, "e": XXXX, "t": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_2.13.0"]}
55
END RequestId: XXXX

tests/integration/snapshots/async-metrics-python37.return_value renamed to tests/integration/snapshots/async-metrics_python37.return_value

File renamed without changes.

tests/integration/snapshots/async-metrics-python38.logs renamed to tests/integration/snapshots/async-metrics_python38.logs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
START RequestId: XXXX Version: $LATEST
2-
{"m": "aws.lambda.enhanced.invocations", "v": 1, "e": XXXX, "t": ["region:us-east-1", "account_id:601427279990", "functionname:integration-tester-dev-async-metrics-python38", "cold_start:true", "memorysize:1024", "runtime:python3.8", "dd_lambda_layer:datadog-python38_2.13.0"]}
2+
{"m": "aws.lambda.enhanced.invocations", "v": 1, "e": XXXX, "t": ["region:us-east-1", "account_id:601427279990", "functionname:integration-tester-dev-async-metrics_python38", "cold_start:true", "memorysize:1024", "runtime:python3.8", "dd_lambda_layer:datadog-python38_2.13.0"]}
33
{"m": "hello.dog", "v": 1, "e": XXXX, "t": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_2.13.0"]}
44
{"m": "tests.integration.count", "v": 21, "e": XXXX, "t": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_2.13.0"]}
55
END RequestId: XXXX

tests/integration/snapshots/async-metrics-python38.return_value renamed to tests/integration/snapshots/async-metrics_python38.return_value

File renamed without changes.

0 commit comments

Comments
 (0)