fix: switch to use cluster ID 1 for RLN

This commit is contained in:
Roman 2024-04-15 15:32:48 +08:00
parent 004b8f6089
commit 5ee97c6610
No known key found for this signature in database
GPG Key ID: B8FE070B54E11B75
2 changed files with 18 additions and 12 deletions

View File

@ -148,3 +148,5 @@ SAMPLE_TIMESTAMPS = [
{"description": "ISO 8601 timestamp", "value": "2023-12-26T10:58:51", "valid_for": []}, {"description": "ISO 8601 timestamp", "value": "2023-12-26T10:58:51", "valid_for": []},
{"description": "Missing", "value": None, "valid_for": ["gowaku"]}, {"description": "Missing", "value": None, "valid_for": ["gowaku"]},
] ]
PUBSUB_TOPICS_RLN = ["/waku/2/rs/1/0"]

View File

@ -2,23 +2,27 @@ import os
import pytest import pytest
from src.env_vars import RLN_CREDENTIALS from src.env_vars import RLN_CREDENTIALS
from src.libs.common import delay, to_base64
from src.libs.custom_logger import get_custom_logger from src.libs.custom_logger import get_custom_logger
from src.steps.relay import StepsRelay from src.steps.relay import StepsRelay
from src.test_data import SAMPLE_INPUTS, PUBSUB_TOPICS_RLN
logger = get_custom_logger(__name__) logger = get_custom_logger(__name__)
@pytest.mark.usefixtures() @pytest.mark.usefixtures("register_main_rln_relay_nodes", "setup_main_rln_relay_nodes", "subscribe_main_relay_nodes")
class TestRelayRLN(StepsRelay): class TestRelayRLN(StepsRelay):
def test_register_rln(self): test_pubsub_topic = PUBSUB_TOPICS_RLN[0]
logger.debug("Running register RLN test for main relay nodes")
key_stores_found = 0
if RLN_CREDENTIALS is None: def test_publish_valid_payloads_at_slow_pace(self):
pytest.skip("RLN_CREDENTIALS not set, skipping test") failed_payloads = []
for payload in SAMPLE_INPUTS:
for k in range(1, 6): logger.debug(f'Running test with payload {payload["description"]}')
self.register_rln_single_node(rln_creds_source=RLN_CREDENTIALS, rln_creds_id=f"{k}") message = self.create_message(payload=to_base64(payload["value"]))
self.check_rln_registration(k) try:
key_stores_found += 1 self.check_published_message_reaches_relay_peer(message)
assert key_stores_found == 5, f"Invalid number of RLN keystores found, expected 5 found {key_stores_found}" except Exception as e:
logger.error(f'Payload {payload["description"]} failed: {str(e)}')
failed_payloads.append(payload["description"])
delay(1)
assert not failed_payloads, f"Payloads failed: {failed_payloads}"