Skip to content

Commit

Permalink
feat: update test markers
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhoheiser committed May 7, 2024
1 parent 81d63c0 commit aae673a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/aws/services/events/test_events.py
Expand Up @@ -651,7 +651,7 @@ def test_list_event_buses_with_limit(self, create_event_bus, aws_client, snapsho
)
snapshot.match("list-event-buses-limit-next-token", response)

@markers.aws.unknown
@markers.aws.needs_fixing # TODO use fixture setup_sqs_queue_as_event_target to simplify
@pytest.mark.skipif(is_aws_cloud(), reason="not validated")
@pytest.mark.parametrize("strategy", ["standard", "domain", "path"])
def test_put_events_into_event_bus(
Expand Down
21 changes: 15 additions & 6 deletions tests/aws/services/events/test_events_integrations.py
Expand Up @@ -83,8 +83,9 @@ def test_put_events_with_target_sqs_new_region(aws_client_factory):
assert "EventId" in response.get("Entries")[0]


@markers.aws.unknown
def test_put_events_with_target_sqs_event_detail_match(put_events_with_filter_to_sqs):
@markers.aws.validated
@pytest.mark.skipif(is_v2_provider(), reason="V2 provider does not support this feature yet")
def test_put_events_with_target_sqs_event_detail_match(put_events_with_filter_to_sqs, snapshot):
entries1 = [
{
"Source": TEST_EVENT_PATTERN["source"][0],
Expand All @@ -100,17 +101,25 @@ def test_put_events_with_target_sqs_event_detail_match(put_events_with_filter_to
}
]
entries_asserts = [(entries1, True), (entries2, False)]
put_events_with_filter_to_sqs(
messages = put_events_with_filter_to_sqs(
pattern={"detail": {"EventType": ["0", "1"]}},
entries_asserts=entries_asserts,
input_path="$.detail",
)

snapshot.add_transformers_list(
[
snapshot.transform.key_value("ReceiptHandle", reference_replacement=False),
snapshot.transform.key_value("MD5OfBody", reference_replacement=False),
],
)
snapshot.match("messages", messages)


# TODO: further unify/parameterize the tests for the different target types below


@markers.aws.unknown
@markers.aws.needs_fixing
@pytest.mark.parametrize("strategy", ["standard", "domain", "path"])
def test_put_events_with_target_sns(
monkeypatch,
Expand Down Expand Up @@ -179,7 +188,7 @@ def test_put_events_with_target_sns(
)


@markers.aws.unknown
@markers.aws.needs_fixing
def test_put_events_with_target_lambda(create_lambda_function, cleanups, aws_client, clean_up):
rule_name = f"rule-{short_uid()}"
function_name = f"lambda-func-{short_uid()}"
Expand Down Expand Up @@ -484,7 +493,7 @@ def check_invocation():
retry(check_invocation, sleep=5, retries=15)


@markers.aws.unknown
@markers.aws.needs_fixing
def test_put_events_with_target_firehose(aws_client, clean_up):
s3_bucket = "s3-{}".format(short_uid())
s3_prefix = "testeventdata"
Expand Down
15 changes: 15 additions & 0 deletions tests/aws/services/events/test_events_integrations.snapshot.json
Expand Up @@ -129,5 +129,20 @@
}
]
}
},
"tests/aws/services/events/test_events_integrations.py::test_put_events_with_target_sqs_event_detail_match": {
"recorded-date": "07-05-2024, 10:40:38",
"recorded-content": {
"messages": [
{
"MessageId": "<uuid:1>",
"ReceiptHandle": "receipt-handle",
"MD5OfBody": "m-d5-of-body",
"Body": {
"EventType": "1"
}
}
]
}
}
}
Expand Up @@ -9,7 +9,7 @@
"last_validated_date": "2024-04-26T08:43:27+00:00"
},
"tests/aws/services/events/test_events_integrations.py::test_put_events_with_target_sqs_event_detail_match": {
"last_validated_date": "2024-03-26T15:50:07+00:00"
"last_validated_date": "2024-05-07T10:40:38+00:00"
},
"tests/aws/services/events/test_events_integrations.py::test_should_ignore_schedules_for_put_event": {
"last_validated_date": "2024-03-26T15:51:47+00:00"
Expand Down

0 comments on commit aae673a

Please sign in to comment.