Skip to content

Commit fcc65e6

Browse files
committed
fix, and enable lambda integration tests
1 parent a80b5d1 commit fcc65e6

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

tests/aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <aws/lambda/model/GetEventSourceMappingRequest.h>
3232
#include <aws/lambda/model/UpdateEventSourceMappingRequest.h>
3333
#include <aws/lambda/model/DeleteEventSourceMappingRequest.h>
34-
#include <aws/lambda/model/ResourceNotFoundException.h>
3534

3635
#include <aws/kinesis/KinesisClient.h>
3736
#include <aws/kinesis/model/CreateStreamRequest.h>
@@ -247,14 +246,14 @@ class FunctionTest : public ::testing::Test {
247246

248247
functionCode.SetZipFile(Aws::Utils::ByteBuffer((unsigned char*)buffer.str().c_str(), buffer.str().length()));
249248
createFunctionRequest.SetCode(functionCode);
250-
createFunctionRequest.SetRuntime(Aws::Lambda::Model::Runtime::nodejs12_x);
249+
createFunctionRequest.SetRuntime(Aws::Lambda::Model::Runtime::nodejs22_x);
251250

252251
CreateFunctionOutcome createFunctionOutcome = m_client->CreateFunction(createFunctionRequest);
253252
AWS_ASSERT_SUCCESS(createFunctionOutcome);
254253
ASSERT_EQ(functionName,createFunctionOutcome.GetResult().GetFunctionName());
255254
ASSERT_EQ("test.handler",createFunctionOutcome.GetResult().GetHandler());
256255
ASSERT_EQ(roleARN,createFunctionOutcome.GetResult().GetRole());
257-
ASSERT_EQ(Aws::Lambda::Model::Runtime::nodejs12_x, createFunctionOutcome.GetResult().GetRuntime());
256+
ASSERT_EQ(Aws::Lambda::Model::Runtime::nodejs22_x, createFunctionOutcome.GetResult().GetRuntime());
258257
functionArnMapping[functionName] = createFunctionOutcome.GetResult().GetFunctionArn();
259258

260259
WaitForFunctionStatus(functionName, Aws::Lambda::Model::State::Active);
@@ -316,7 +315,7 @@ TEST_F(FunctionTest, TestGetFunction)
316315
AWS_EXPECT_SUCCESS(getFunctionOutcome);
317316

318317
GetFunctionResult getFunctionResult = getFunctionOutcome.GetResult();
319-
EXPECT_EQ(Runtime::nodejs12_x, getFunctionResult.GetConfiguration().GetRuntime());
318+
EXPECT_EQ(Runtime::nodejs22_x, getFunctionResult.GetConfiguration().GetRuntime());
320319
EXPECT_EQ("test.handler",getFunctionResult.GetConfiguration().GetHandler());
321320
EXPECT_EQ(simpleFunctionName,getFunctionResult.GetConfiguration().GetFunctionName());
322321
//Just see that is looks like an aws url
@@ -334,7 +333,7 @@ TEST_F(FunctionTest, TestGetFunctionConfiguration)
334333
AWS_EXPECT_SUCCESS(getFunctionConfigurationOutcome);
335334

336335
GetFunctionConfigurationResult getFunctionConfigurationResult = getFunctionConfigurationOutcome.GetResult();
337-
EXPECT_EQ(Runtime::nodejs12_x, getFunctionConfigurationResult.GetRuntime());
336+
EXPECT_EQ(Runtime::nodejs22_x, getFunctionConfigurationResult.GetRuntime());
338337
EXPECT_EQ("test.handler",getFunctionConfigurationResult.GetHandler());
339338
EXPECT_EQ(simpleFunctionName,getFunctionConfigurationResult.GetFunctionName());
340339
}
@@ -490,7 +489,6 @@ TEST_F(FunctionTest, TestPermissions)
490489
if (!getRemovedPolicyOutcome.IsSuccess())
491490
{
492491
EXPECT_EQ(LambdaErrors::RESOURCE_NOT_FOUND, getRemovedPolicyOutcome.GetError().GetErrorType());
493-
EXPECT_STREQ("User", getRemovedPolicyOutcome.GetError<ResourceNotFoundException>().GetType().c_str());
494492
}
495493
//Now we should get an empty policy a GetPolicy because we just removed it
496494
else

tools/scripts/build-tests/run-al2-integ-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ AWS_ROLE_SESSION_NAME="$3"
2121

2222
echo "Setting the run environment"
2323
export TEST_ASSUME_ROLE_ARN=arn:aws:iam::${AWS_ACCOUNT}:role/IntegrationTest
24-
export TEST_LAMBDA_CODE_PATH=${PREFIX_DIR}/aws-sdk-cpp/tools/aws-cpp-sdk-lambda-integration-tests/resources
24+
export TEST_LAMBDA_CODE_PATH=${PREFIX_DIR}/aws-sdk-cpp/tests/aws-cpp-sdk-lambda-integration-tests/resources
2525
export sts=$(aws sts assume-role --role-arn "$TEST_ASSUME_ROLE_ARN" --role-session-name "${AWS_ROLE_SESSION_NAME}" --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]')
2626
export profile=sdk-integ-test
2727
aws configure set aws_access_key_id $(echo "$sts" | jq -r '.[0]') --profile "$profile"

tools/scripts/run_integration_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def main():
4545
"aws-cpp-sdk-s3-unit-tests",
4646
"aws-cpp-sdk-s3-crt-integration-tests",
4747
#"aws-cpp-sdk-s3control-integration-tests",
48-
# "aws-cpp-sdk-lambda-integration-tests",
48+
"aws-cpp-sdk-lambda-integration-tests",
4949
"aws-cpp-sdk-cognitoidentity-integration-tests",
5050
#"aws-cpp-sdk-transfer-tests",
5151
#"aws-cpp-sdk-s3-encryption-integration-tests",

0 commit comments

Comments
 (0)