Skip to content

Commit

Permalink
Various integration test fixes (ansible-collections#984)
Browse files Browse the repository at this point in the history
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 (ansible-collections#985)

Fixes: ansible-collections#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 <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@c5e4640
  • Loading branch information
tremble authored and goneri committed Sep 21, 2022
1 parent d895f0f commit 68dda60
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/integration/targets/lambda/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand All @@ -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 }}'
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/targets/lambda_alias/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/lambda_policy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}'
Expand Down

0 comments on commit 68dda60

Please sign in to comment.