mirror of
https://github.com/logos-messaging/logos-messaging-interop-tests.git
synced 2026-05-24 11:19:43 +00:00
test: add filter to fleet tests
This commit is contained in:
parent
0b305f1f0e
commit
dea43b5618
@ -12,6 +12,7 @@ logger = get_custom_logger(__name__)
|
||||
@pytest.mark.usefixtures("setup_main_relay_node", "setup_main_filter_node", "subscribe_main_nodes")
|
||||
class TestFilterGetMessages(StepsFilter):
|
||||
@pytest.mark.smoke
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_get_message_with_valid_payloads(self):
|
||||
failed_payloads = []
|
||||
for payload in SAMPLE_INPUTS:
|
||||
@ -24,6 +25,7 @@ class TestFilterGetMessages(StepsFilter):
|
||||
failed_payloads.append(payload["description"])
|
||||
assert not failed_payloads, f"Payloads failed: {failed_payloads}"
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_get_message_with_valid_timestamps(self):
|
||||
failed_timestamps = []
|
||||
for timestamp in SAMPLE_TIMESTAMPS:
|
||||
@ -37,12 +39,15 @@ class TestFilterGetMessages(StepsFilter):
|
||||
failed_timestamps.append(timestamp)
|
||||
assert not failed_timestamps, f"Timestamps failed: {failed_timestamps}"
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_get_message_with_version(self):
|
||||
self.check_published_message_reaches_filter_peer(self.create_message(version=10))
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_get_message_with_meta(self):
|
||||
self.check_published_message_reaches_filter_peer(self.create_message(meta=to_base64(self.test_payload)))
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_get_message_with_ephemeral(self):
|
||||
failed_ephemeral = []
|
||||
for ephemeral in [True, False]:
|
||||
@ -54,6 +59,7 @@ class TestFilterGetMessages(StepsFilter):
|
||||
failed_ephemeral.append(ephemeral)
|
||||
assert not failed_ephemeral, f"Ephemeral that failed: {failed_ephemeral}"
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_get_message_with_extra_field(self):
|
||||
try:
|
||||
self.check_published_message_reaches_filter_peer(self.create_message(extraField="extraValue"))
|
||||
|
||||
@ -10,6 +10,7 @@ logger = get_custom_logger(__name__)
|
||||
|
||||
@pytest.mark.usefixtures("setup_main_relay_node", "setup_main_filter_node")
|
||||
class TestFilterSubscribeCreate(StepsFilter):
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_subscribe_to_single_topics(self):
|
||||
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic])
|
||||
self.check_published_message_reaches_filter_peer()
|
||||
@ -47,6 +48,7 @@ class TestFilterSubscribeCreate(StepsFilter):
|
||||
failed_pubsub_topics.append(pubsub_topic)
|
||||
assert not failed_pubsub_topics, f"PubsubTopics failed: {failed_pubsub_topics}"
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_subscribe_to_100_content_topics_in_one_call(self):
|
||||
failed_content_topics = []
|
||||
_100_content_topics = [str(i) for i in range(100)]
|
||||
@ -98,6 +100,7 @@ class TestFilterSubscribeCreate(StepsFilter):
|
||||
except Exception as ex:
|
||||
assert "Bad Request" in str(ex)
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_subscribe_refresh(self):
|
||||
for _ in range(2):
|
||||
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic])
|
||||
@ -159,6 +162,7 @@ class TestFilterSubscribeCreate(StepsFilter):
|
||||
except Exception as ex:
|
||||
assert "Bad Request" in str(ex)
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_subscribe_with_extra_field(self, subscribe_main_nodes):
|
||||
try:
|
||||
self.create_filter_subscription(
|
||||
|
||||
@ -8,6 +8,7 @@ logger = get_custom_logger(__name__)
|
||||
|
||||
@pytest.mark.usefixtures("setup_main_relay_node", "setup_main_filter_node")
|
||||
class TestFilterSubscribeUpdate(StepsFilter):
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_update_subscription_add_a_new_content_topic(self):
|
||||
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic], pubsub_topic=self.test_pubsub_topic)
|
||||
self.update_filter_subscription({"requestId": "1", "contentFilters": [self.second_content_topic], "pubsubTopic": self.test_pubsub_topic})
|
||||
@ -39,6 +40,7 @@ class TestFilterSubscribeUpdate(StepsFilter):
|
||||
except Exception as ex:
|
||||
assert "Bad Request" in str(ex)
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_update_subscription_refresh_existing(self):
|
||||
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic], pubsub_topic=self.test_pubsub_topic)
|
||||
self.update_filter_subscription({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic})
|
||||
|
||||
@ -5,11 +5,13 @@ from src.steps.filter import StepsFilter
|
||||
|
||||
@pytest.mark.usefixtures("setup_main_relay_node", "setup_main_filter_node", "subscribe_main_nodes")
|
||||
class TestFilterUnSubscribe(StepsFilter):
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_unsubscribe_from_single_content_topic(self):
|
||||
self.check_published_message_reaches_filter_peer()
|
||||
self.delete_filter_subscription({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic})
|
||||
self.check_publish_without_filter_subscription()
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_unsubscribe_from_all_subscribed_content_topics(self):
|
||||
content_topics = [input["value"] for input in SAMPLE_INPUTS[:2]]
|
||||
self.wait_for_subscriptions_on_main_nodes(content_topics)
|
||||
@ -25,6 +27,7 @@ class TestFilterUnSubscribe(StepsFilter):
|
||||
self.check_published_message_reaches_filter_peer(self.create_message(contentTopic=content_topics[1]))
|
||||
self.check_publish_without_filter_subscription(self.create_message(contentTopic=content_topics[0]))
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_unsubscribe_from_pubsub_topics(self):
|
||||
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic], self.test_pubsub_topic)
|
||||
self.wait_for_subscriptions_on_main_nodes([self.second_content_topic], self.second_pubsub_topic)
|
||||
|
||||
@ -6,6 +6,7 @@ from random import choice
|
||||
|
||||
@pytest.mark.usefixtures("setup_main_relay_node", "setup_main_filter_node")
|
||||
class TestFilterUnSubscribeAll(StepsFilter):
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_unsubscribe_all_from_few_content_topics(self):
|
||||
content_topics = [input["value"] for input in SAMPLE_INPUTS[:5]]
|
||||
self.wait_for_subscriptions_on_main_nodes(content_topics)
|
||||
@ -30,6 +31,7 @@ class TestFilterUnSubscribeAll(StepsFilter):
|
||||
self.check_publish_without_filter_subscription(self.create_message(contentTopic=choice(second_list)))
|
||||
self.check_publish_without_filter_subscription(self.create_message(contentTopic=choice(third_list)))
|
||||
|
||||
@pytest.mark.waku_test_fleet
|
||||
def test_filter_unsubscribe_all_from_multiple_pubsub_topics(self):
|
||||
for pubsub_topic in VALID_PUBSUB_TOPICS:
|
||||
content_topic = pubsub_topic
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user