-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Unskip supported Lambda and ESM tests #12012
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,6 @@ | |
from localstack.utils.testutil import create_lambda_archive, get_lambda_log_events | ||
|
||
|
||
# TODO: Fix for new Lambda provider (was tested for old provider) | ||
@pytest.mark.skip(reason="not implemented yet in new provider") | ||
@markers.aws.validated | ||
def test_lambda_w_dynamodb_event_filter(deploy_cfn_template, aws_client): | ||
function_name = f"test-fn-{short_uid()}" | ||
|
@@ -53,13 +51,11 @@ def _assert_single_lambda_call(): | |
retry(_assert_single_lambda_call, retries=30) | ||
|
||
|
||
# TODO make a test simular to one above but for updated filtering | ||
|
||
|
||
@markers.snapshot.skip_snapshot_verify( | ||
[ | ||
"$..EventSourceMappings..FunctionArn", | ||
"$..EventSourceMappings..LastProcessingResult", | ||
# TODO: Fix flaky ESM state mismatch upon update in LocalStack (expected Enabled, actual Disabled) | ||
# This might be a parity issue if AWS does rolling updates (i.e., never disables the ESM upon update). | ||
"$..EventSourceMappings..State", | ||
] | ||
) | ||
@markers.aws.validated | ||
|
@@ -261,7 +257,6 @@ def test_lambda_alias(deploy_cfn_template, snapshot, aws_client): | |
not in_default_partition(), reason="Test not applicable in non-default partitions" | ||
) | ||
@markers.aws.validated | ||
@markers.snapshot.skip_snapshot_verify(paths=["$..DestinationConfig"]) | ||
def test_lambda_code_signing_config(deploy_cfn_template, snapshot, account_id, aws_client): | ||
snapshot.add_transformer(snapshot.transform.cloudformation_api()) | ||
snapshot.add_transformer(snapshot.transform.lambda_api()) | ||
|
@@ -305,7 +300,12 @@ def test_event_invoke_config(deploy_cfn_template, snapshot, aws_client): | |
snapshot.match("event_invoke_config", event_invoke_config) | ||
|
||
|
||
@markers.snapshot.skip_snapshot_verify(paths=["$..CodeSize"]) | ||
@markers.snapshot.skip_snapshot_verify( | ||
paths=[ | ||
# Lambda ZIP flaky in CI | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dfangl @dominikschubert Is that assumption correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usually yes, we cannot totally rely on this, as it might change. |
||
"$..CodeSize", | ||
] | ||
) | ||
@markers.aws.validated | ||
def test_lambda_version(deploy_cfn_template, snapshot, aws_client): | ||
snapshot.add_transformer(snapshot.transform.cloudformation_api()) | ||
|
@@ -462,7 +462,6 @@ def test_lambda_vpc(deploy_cfn_template, aws_client): | |
aws_client.lambda_.invoke(FunctionName=fn_name, LogType="Tail", Payload=b"{}") | ||
|
||
|
||
@pytest.mark.skip(reason="fails/times out with new provider") # FIXME | ||
@markers.aws.validated | ||
def test_update_lambda_permissions(deploy_cfn_template, aws_client): | ||
stack = deploy_cfn_template( | ||
|
@@ -619,16 +618,12 @@ def wait_logs(): | |
|
||
@markers.snapshot.skip_snapshot_verify( | ||
paths=[ | ||
"$..MaximumRetryAttempts", | ||
"$..ParallelizationFactor", | ||
"$..StateTransitionReason", | ||
# Lambda | ||
"$..Tags", | ||
"$..Configuration.CodeSize", | ||
"$..Configuration.Layers", | ||
"$..Configuration.CodeSize", # Lambda ZIP flaky in CI | ||
# SQS | ||
"$..Attributes.SqsManagedSseEnabled", | ||
# # IAM | ||
# IAM | ||
"$..PolicyNames", | ||
"$..PolicyName", | ||
"$..Role.Description", | ||
|
@@ -742,12 +737,8 @@ def wait_logs(): | |
with pytest.raises(aws_client.lambda_.exceptions.ResourceNotFoundException): | ||
aws_client.lambda_.get_event_source_mapping(UUID=esm_id) | ||
|
||
# TODO: consider moving into the dedicated DynamoDB => Lambda tests | ||
# TODO: consider moving into the dedicated DynamoDB => Lambda tests because it tests the filtering functionality rather than CloudFormation (just using CF to deploy resources) | ||
# tests.aws.services.lambda_.test_lambda_integration_dynamodbstreams.TestDynamoDBEventSourceMapping.test_dynamodb_event_filter | ||
@pytest.mark.skipif( | ||
config.EVENT_RULE_ENGINE != "java", | ||
reason="Filtering is broken with the Python rule engine for this specific case (exists:false) in ESM v2", | ||
) | ||
@markers.aws.validated | ||
def test_lambda_dynamodb_event_filter( | ||
self, dynamodb_wait_for_table_active, deploy_cfn_template, aws_client, monkeypatch | ||
|
@@ -786,8 +777,7 @@ def _send_events(): | |
paths=[ | ||
# Lambda | ||
"$..Tags", | ||
"$..Configuration.CodeSize", | ||
"$..Configuration.Layers", | ||
"$..Configuration.CodeSize", # Lambda ZIP flaky in CI | ||
# IAM | ||
"$..PolicyNames", | ||
"$..policies..PolicyName", | ||
|
@@ -801,12 +791,6 @@ def _send_events(): | |
"$..Table.Replicas", | ||
# stream result | ||
"$..StreamDescription.CreationRequestDateTime", | ||
# event source mapping | ||
"$..BisectBatchOnFunctionError", | ||
"$..DestinationConfig", | ||
"$..LastProcessingResult", | ||
"$..MaximumRecordAgeInSeconds", | ||
"$..TumblingWindowInSeconds", | ||
] | ||
) | ||
@markers.aws.validated | ||
|
@@ -929,16 +913,9 @@ def wait_logs(): | |
paths=[ | ||
"$..Role.Description", | ||
"$..Role.MaxSessionDuration", | ||
"$..BisectBatchOnFunctionError", | ||
"$..DestinationConfig", | ||
"$..LastProcessingResult", | ||
"$..MaximumRecordAgeInSeconds", | ||
"$..Configuration.CodeSize", | ||
"$..Tags", | ||
"$..StreamDescription.StreamModeDetails", | ||
"$..Configuration.Layers", | ||
"$..TumblingWindowInSeconds", | ||
# flaky because we currently don't actually wait in cloudformation for it to be active | ||
# TODO: wait for ESM to become active in CloudFormation to mitigate these flaky fields | ||
"$..Configuration.LastUpdateStatus", | ||
"$..Configuration.State", | ||
"$..Configuration.StateReason", | ||
|
@@ -1094,11 +1071,11 @@ class TestCfnLambdaDestinations: | |
|
||
""" | ||
|
||
@pytest.mark.skip(reason="not supported atm and test needs further work") | ||
@pytest.mark.parametrize( | ||
["on_success", "on_failure"], | ||
[ | ||
("sqs", "sqs"), | ||
# TODO: test needs further work | ||
# ("sns", "sns"), | ||
# ("lambda", "lambda"), | ||
# ("eventbridge", "eventbridge") | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍