From 5a8d562ce26f10c41c5e608a8a72ee00d042b60d Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Mon, 14 Mar 2022 15:20:07 +0100 Subject: [PATCH] Various integration test fixes (#984) Various integration test fixes SUMMARY Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests Updates the version of NodeJS used by the lambda in the lamba integration tests Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update Cleans up Snapshots from rds_instance integration tests Disables broken WAFv2 integration test (#985) Fixes: #976 ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_secret lambda lambda_alias lambda_policy rds_policy s3_bucket_notification wafv2 ADDITIONAL INFORMATION Amazon appear to have dropped support for creating Python2.7 lambdas: botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions. Reviewed-by: Alina Buzachis This commit was initially merged in https://github.com/ansible-collections/community.aws See: https://github.com/ansible-collections/community.aws/commit/c5e464000b35111f000fe2e1c44c39cbeffdc76b --- tests/integration/targets/lambda/tasks/main.yml | 8 ++++---- tests/integration/targets/lambda_alias/tasks/main.yml | 6 +++--- tests/integration/targets/lambda_policy/tasks/main.yml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/integration/targets/lambda/tasks/main.yml b/tests/integration/targets/lambda/tasks/main.yml index 8846a01cb41..a7a1680d9e6 100644 --- a/tests/integration/targets/lambda/tasks/main.yml +++ b/tests/integration/targets/lambda/tasks/main.yml @@ -125,7 +125,7 @@ - name: test lambda config updates lambda: name: '{{lambda_function_name}}' - runtime: nodejs10.x + runtime: nodejs14.x tracing_mode: Active handler: mini_lambda.handler role: '{{ lambda_role_name }}' @@ -139,13 +139,13 @@ that: - update_result is not failed - update_result.changed == True - - update_result.configuration.runtime == 'nodejs10.x' + - update_result.configuration.runtime == 'nodejs14.x' - update_result.configuration.tracing_config.mode == 'Active' - name: test no changes are made with the same parameters repeated lambda: name: '{{lambda_function_name}}' - runtime: nodejs10.x + runtime: nodejs14.x tracing_mode: Active handler: mini_lambda.handler role: '{{ lambda_role_name }}' @@ -159,7 +159,7 @@ that: - update_result is not failed - update_result.changed == False - - update_result.configuration.runtime == 'nodejs10.x' + - update_result.configuration.runtime == 'nodejs14.x' - update_result.configuration.tracing_config.mode == 'Active' - name: reset config updates for the following tests diff --git a/tests/integration/targets/lambda_alias/tasks/main.yml b/tests/integration/targets/lambda_alias/tasks/main.yml index 6796d14cca6..9b264f50c0a 100644 --- a/tests/integration/targets/lambda_alias/tasks/main.yml +++ b/tests/integration/targets/lambda_alias/tasks/main.yml @@ -37,7 +37,7 @@ - name: Upload test lambda (version 1) lambda: name: '{{ lambda_function_name }}' - runtime: 'python2.7' + runtime: 'python3.7' handler: 'mini_lambda.handler' role: '{{ lambda_role_name }}' zip_file: '{{ zip_res.dest }}' @@ -50,7 +50,7 @@ - name: Update lambda (version 2) lambda: name: '{{ lambda_function_name }}' - runtime: 'python3.6' + runtime: 'python3.8' handler: 'mini_lambda.handler' role: '{{ lambda_role_name }}' register: lambda_b @@ -62,7 +62,7 @@ - name: Update lambda (version 3 / LATEST) lambda: name: '{{ lambda_function_name }}' - runtime: 'python3.7' + runtime: 'python3.9' handler: 'mini_lambda.handler' role: '{{ lambda_role_name }}' register: lambda_c diff --git a/tests/integration/targets/lambda_policy/tasks/main.yml b/tests/integration/targets/lambda_policy/tasks/main.yml index 2b0e3d38f9f..e0b514bde43 100644 --- a/tests/integration/targets/lambda_policy/tasks/main.yml +++ b/tests/integration/targets/lambda_policy/tasks/main.yml @@ -61,7 +61,7 @@ - name: test state=present - upload the lambda lambda: name: '{{lambda_function_name}}' - runtime: python2.7 + runtime: python3.9 handler: mini_http_lambda.handler role: '{{ lambda_role_name }}' zip_file: '{{zip_res.dest}}'