waku-interop-tests/tests/relay/test_multiple_nodes.py
AYAHASSAN287 013c6e8bb0
smoke_tests (#90)
* Selecting initial smoke tests set

* adding mark "smoke" in pytest.ini

* adding mark smoke to workflow file

* Remove allure reporting from yml file

* Adding more smoke tests

* Add PR image to new nwaku workflow

* change nwaku_daily.yml to test the PR job changes

* remove dependencies from yml file

* Remove secrets check from container yml file

* remove secrets from all files

* change image tag

* revert image tag

* Revert nwaku_daily.yml to origin

* Adding PR number to choose image

* adding docker-build-image to yml file

* adding docker-image-build dependencies

* Adding quay user & password

* Adding quay username & password

* Fix yml build

* Remove changes causing errors

* remove tests part to speedup the job

* add flag workflow_call: for reusable workflow

* checkout on branch instead of master

* trying to fetch from branch

* Check out specific branch

* make node1 input

* Adding node1 as input

* Add type to required input

* fix node input format

* change input node1 format

* Delete .github/workflows/container-image.yml

* Delete .github/workflows/nim_nwaku_pr.yml

* Create 2  files for PR tests

* revert original yml files

* Fix review points on PR

* fix review points

* revert test_common file to master

* revert nim_waku_daily to master

* Fix review points
2024-12-12 11:03:42 +02:00

37 lines
2.0 KiB
Python

import pytest
from src.steps.relay import StepsRelay
@pytest.mark.usefixtures("setup_main_relay_nodes", "setup_optional_relay_nodes", "subscribe_main_relay_nodes")
class TestRelayMultipleNodes(StepsRelay):
@pytest.mark.smoke
def test_first_node_to_start_publishes(self, subscribe_optional_relay_nodes, relay_warm_up):
self.check_published_message_reaches_relay_peer()
def test_last_node_to_start_publishes(self, subscribe_optional_relay_nodes, relay_warm_up):
self.check_published_message_reaches_relay_peer(sender=self.optional_nodes[-1])
def test_optional_nodes_not_subscribed_to_same_pubsub_topic(self):
self.wait_for_published_message_to_reach_relay_peer(peer_list=self.main_nodes)
try:
self.check_published_message_reaches_relay_peer(peer_list=self.optional_nodes)
raise AssertionError("Non subscribed nodes received the message!!")
except Exception as ex:
assert "Not Found" in str(ex), "Expected 404 Not Found when the message is not found"
def test_relay_get_message_while_one_peer_is_paused(self, subscribe_optional_relay_nodes, relay_warm_up):
self.check_published_message_reaches_relay_peer()
relay_message1 = self.create_message(contentTopic=self.test_content_topic)
relay_message2 = self.create_message(contentTopic=self.test_content_topic)
self.node2.pause()
self.node1.send_relay_message(relay_message1, self.test_pubsub_topic)
self.node2.unpause()
self.node1.send_relay_message(relay_message2, self.test_pubsub_topic)
messages = self.node2.get_relay_messages(self.test_pubsub_topic)
assert len(messages) == 2, "Both messages should've been returned"
def test_relay_get_message_after_one_peer_was_stopped(self, subscribe_optional_relay_nodes, relay_warm_up):
self.check_published_message_reaches_relay_peer(peer_list=self.main_nodes + self.optional_nodes)
self.node2.stop()
self.wait_for_published_message_to_reach_relay_peer(peer_list=self.optional_nodes)