Skip to content

fix, and enable lambda integration tests #3456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions tests/aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <aws/lambda/model/GetEventSourceMappingRequest.h>
#include <aws/lambda/model/UpdateEventSourceMappingRequest.h>
#include <aws/lambda/model/DeleteEventSourceMappingRequest.h>
#include <aws/lambda/model/ResourceNotFoundException.h>

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

functionCode.SetZipFile(Aws::Utils::ByteBuffer((unsigned char*)buffer.str().c_str(), buffer.str().length()));
createFunctionRequest.SetCode(functionCode);
createFunctionRequest.SetRuntime(Aws::Lambda::Model::Runtime::nodejs12_x);
createFunctionRequest.SetRuntime(Aws::Lambda::Model::Runtime::nodejs22_x);

CreateFunctionOutcome createFunctionOutcome = m_client->CreateFunction(createFunctionRequest);
AWS_ASSERT_SUCCESS(createFunctionOutcome);
ASSERT_EQ(functionName,createFunctionOutcome.GetResult().GetFunctionName());
ASSERT_EQ("test.handler",createFunctionOutcome.GetResult().GetHandler());
ASSERT_EQ(roleARN,createFunctionOutcome.GetResult().GetRole());
ASSERT_EQ(Aws::Lambda::Model::Runtime::nodejs12_x, createFunctionOutcome.GetResult().GetRuntime());
ASSERT_EQ(Aws::Lambda::Model::Runtime::nodejs22_x, createFunctionOutcome.GetResult().GetRuntime());
functionArnMapping[functionName] = createFunctionOutcome.GetResult().GetFunctionArn();

WaitForFunctionStatus(functionName, Aws::Lambda::Model::State::Active);
Expand Down Expand Up @@ -316,7 +315,7 @@ TEST_F(FunctionTest, TestGetFunction)
AWS_EXPECT_SUCCESS(getFunctionOutcome);

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

GetFunctionConfigurationResult getFunctionConfigurationResult = getFunctionConfigurationOutcome.GetResult();
EXPECT_EQ(Runtime::nodejs12_x, getFunctionConfigurationResult.GetRuntime());
EXPECT_EQ(Runtime::nodejs22_x, getFunctionConfigurationResult.GetRuntime());
EXPECT_EQ("test.handler",getFunctionConfigurationResult.GetHandler());
EXPECT_EQ(simpleFunctionName,getFunctionConfigurationResult.GetFunctionName());
}
Expand Down Expand Up @@ -490,7 +489,6 @@ TEST_F(FunctionTest, TestPermissions)
if (!getRemovedPolicyOutcome.IsSuccess())
{
EXPECT_EQ(LambdaErrors::RESOURCE_NOT_FOUND, getRemovedPolicyOutcome.GetError().GetErrorType());
EXPECT_STREQ("User", getRemovedPolicyOutcome.GetError<ResourceNotFoundException>().GetType().c_str());
}
//Now we should get an empty policy a GetPolicy because we just removed it
else
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/build-tests/run-al2-integ-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AWS_ROLE_SESSION_NAME="$3"

echo "Setting the run environment"
export TEST_ASSUME_ROLE_ARN=arn:aws:iam::${AWS_ACCOUNT}:role/IntegrationTest
export TEST_LAMBDA_CODE_PATH=${PREFIX_DIR}/aws-sdk-cpp/tools/aws-cpp-sdk-lambda-integration-tests/resources
export TEST_LAMBDA_CODE_PATH=${PREFIX_DIR}/aws-sdk-cpp/tests/aws-cpp-sdk-lambda-integration-tests/resources
export sts=$(aws sts assume-role --role-arn "$TEST_ASSUME_ROLE_ARN" --role-session-name "${AWS_ROLE_SESSION_NAME}" --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]')
export profile=sdk-integ-test
aws configure set aws_access_key_id $(echo "$sts" | jq -r '.[0]') --profile "$profile"
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/run_integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def main():
"aws-cpp-sdk-s3-unit-tests",
"aws-cpp-sdk-s3-crt-integration-tests",
#"aws-cpp-sdk-s3control-integration-tests",
# "aws-cpp-sdk-lambda-integration-tests",
"aws-cpp-sdk-lambda-integration-tests",
"aws-cpp-sdk-cognitoidentity-integration-tests",
#"aws-cpp-sdk-transfer-tests",
#"aws-cpp-sdk-s3-encryption-integration-tests",
Expand Down