Skip to content

Commit 263a330

Browse files
authored
fix: Revert lambda nodejs18.x upgrade (#3326)
1 parent 5aa0a1c commit 263a330

File tree

126 files changed

+201
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+201
-167
lines changed

integration/combination/test_connectors.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from time import sleep
22
from unittest import SkipTest
3+
from unittest.case import skipIf
34

45
from parameterized import parameterized
56
from tenacity import retry, retry_if_exception, stop_after_attempt
67

8+
from integration.config.service_names import SCHEDULE_EVENT
79
from integration.conftest import clean_bucket
810
from integration.helpers.base_test import S3_BUCKET_PREFIX, BaseTest
9-
from integration.helpers.resource import generate_suffix
11+
from integration.helpers.resource import current_region_does_not_support, generate_suffix
1012

1113
retry_once = retry(
1214
stop=stop_after_attempt(2),
@@ -15,6 +17,39 @@
1517
)
1618

1719

20+
# Explicitly move EB tests out to handlle the failed test in some regions.
21+
# In those regions, the tests should have been skipped but somehow not.
22+
# Test using `skipIf` to see if it helps.
23+
@skipIf(
24+
current_region_does_not_support([SCHEDULE_EVENT]),
25+
"SCHEDULE_EVENT is not supported in this testing region",
26+
)
27+
class TestConnectorsWithEventBus(BaseTest):
28+
@parameterized.expand(
29+
[
30+
("combination/connector_function_to_eventbus_write",),
31+
]
32+
)
33+
@retry_once
34+
def test_connector_by_invoking_a_function_with_eventbus(self, template_file_path):
35+
self.create_and_verify_stack(template_file_path)
36+
37+
lambda_function_name = self.get_physical_id_by_logical_id("TriggerFunction")
38+
lambda_client = self.client_provider.lambda_client
39+
40+
request_params = {
41+
"FunctionName": lambda_function_name,
42+
"InvocationType": "RequestResponse",
43+
"Payload": "{}",
44+
}
45+
response = lambda_client.invoke(**request_params)
46+
import pdb
47+
48+
pdb.set_trace()
49+
self.assertEqual(response.get("StatusCode"), 200)
50+
self.assertEqual(response.get("FunctionError"), None)
51+
52+
1853
class TestConnectors(BaseTest):
1954
def tearDown(self):
2055
# Some tests will create items in S3 Bucket, which result in stack DELETE_FAILED state
@@ -42,7 +77,6 @@ def tearDown(self):
4277
("combination/connector_function_to_queue_write",),
4378
("combination/connector_function_to_queue_read",),
4479
("combination/connector_function_to_topic_write",),
45-
("combination/connector_function_to_eventbus_write",),
4680
("combination/connector_topic_to_queue_write",),
4781
("combination/connector_event_rule_to_sqs_write",),
4882
("combination/connector_event_rule_to_sns_write",),

integration/resources/templates/combination/api_with_authorizer_apikey.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Resources:
1414
Type: AWS::Serverless::Function
1515
Properties:
1616
Handler: index.handler
17-
Runtime: nodejs18.x
17+
Runtime: nodejs16.x
1818
InlineCode: |
1919
exports.handler = async (event, context, callback) => {
2020
return {
@@ -45,7 +45,7 @@ Resources:
4545
Type: AWS::Serverless::Function
4646
Properties:
4747
Handler: index.handler
48-
Runtime: nodejs18.x
48+
Runtime: nodejs16.x
4949
InlineCode: |
5050
exports.handler = async (event, context, callback) => {
5151
console.log(event);

integration/resources/templates/combination/api_with_authorizers_invokefunction_set_none.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Resources:
3131
InlineCode: |
3232
print("hello")
3333
Handler: index.handler
34-
Runtime: nodejs18.x
34+
Runtime: nodejs16.x
3535
Events:
3636
API3:
3737
Type: Api
@@ -50,7 +50,7 @@ Resources:
5050
InlineCode: |
5151
print("hello")
5252
Handler: index.handler
53-
Runtime: nodejs18.x
53+
Runtime: nodejs16.x
5454
Events:
5555
MyApiWithAwsIamAuth:
5656
Type: Api

integration/resources/templates/combination/api_with_authorizers_max.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Resources:
4343
Type: AWS::Serverless::Function
4444
Properties:
4545
Handler: index.handler
46-
Runtime: nodejs18.x
46+
Runtime: nodejs16.x
4747
InlineCode: |
4848
exports.handler = async (event, context, callback) => {
4949
return {
@@ -101,7 +101,7 @@ Resources:
101101
Type: AWS::Serverless::Function
102102
Properties:
103103
Handler: index.handler
104-
Runtime: nodejs18.x
104+
Runtime: nodejs16.x
105105
InlineCode: |
106106
exports.handler = async (event, context, callback) => {
107107
const token = event.type === 'TOKEN' ? event.authorizationToken : event.queryStringParameters.authorization

integration/resources/templates/combination/api_with_authorizers_max_openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Resources:
4646
Type: AWS::Serverless::Function
4747
Properties:
4848
Handler: index.handler
49-
Runtime: nodejs18.x
49+
Runtime: nodejs16.x
5050
InlineCode: |
5151
exports.handler = async (event, context, callback) => {
5252
return {
@@ -114,7 +114,7 @@ Resources:
114114
Type: AWS::Serverless::Function
115115
Properties:
116116
Handler: index.handler
117-
Runtime: nodejs18.x
117+
Runtime: nodejs16.x
118118
InlineCode: |
119119
exports.handler = async (event, context, callback) => {
120120
const token = event.type === 'TOKEN' ? event.authorizationToken : event.queryStringParameters.authorization

integration/resources/templates/combination/api_with_authorizers_min.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Resources:
2323
Type: AWS::Serverless::Function
2424
Properties:
2525
Handler: index.handler
26-
Runtime: nodejs18.x
26+
Runtime: nodejs16.x
2727
InlineCode: |
2828
exports.handler = async (event, context, callback) => {
2929
return {
@@ -80,7 +80,7 @@ Resources:
8080
Type: AWS::Serverless::Function
8181
Properties:
8282
Handler: index.handler
83-
Runtime: nodejs18.x
83+
Runtime: nodejs16.x
8484
InlineCode: |
8585
exports.handler = async (event, context, callback) => {
8686
const token = event.type === 'TOKEN' ? event.authorizationToken : event.queryStringParameters.authorization

integration/resources/templates/combination/api_with_binary_media_types_with_definition_body_openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Resources:
5151
Type: AWS::Serverless::Function
5252
Properties:
5353
Handler: index.handler
54-
Runtime: nodejs18.x
54+
Runtime: nodejs16.x
5555
CodeUri:
5656
Bucket:
5757
Ref: Bucket

integration/resources/templates/combination/api_with_cors.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Resources:
2222
Type: AWS::Serverless::Function
2323
Properties:
2424
Handler: index.handler
25-
Runtime: nodejs18.x
25+
Runtime: nodejs16.x
2626
CodeUri: ${codeuri}
2727
MemorySize: 128
2828

integration/resources/templates/combination/api_with_cors_and_apikey.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Resources:
2222
body: JSON.stringify({ message: "Hello, SAM!" }),
2323
}
2424
}
25-
Runtime: nodejs18.x
25+
Runtime: nodejs16.x
2626

2727
ApiGatewayLambdaRole:
2828
Type: AWS::IAM::Role

integration/resources/templates/combination/api_with_cors_only_headers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Resources:
2424
Type: AWS::Serverless::Function
2525
Properties:
2626
Handler: index.handler
27-
Runtime: nodejs18.x
27+
Runtime: nodejs16.x
2828
CodeUri: ${codeuri}
2929
MemorySize: 128
3030

0 commit comments

Comments
 (0)