Chore/address failures (#14)

* address failures

* job for interop tests

* fix branch name

* fix remaining tests

* see job name

* set caller input

* split reports per caller

* trigger again

* try with publish_dir

* small fix

* small fix

* remove on pr
This commit is contained in:
Florin Barbu 2024-01-19 12:56:55 +02:00 committed by GitHub
parent ae3addb619
commit de60598b6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 77 additions and 31 deletions

View File

@ -16,6 +16,4 @@ jobs:
with:
node1: "harbor.status.im/wakuorg/go-waku:latest"
node2: "harbor.status.im/wakuorg/go-waku:latest"
caller: "go"

33
.github/workflows/interop_tests.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: On Demand Interop Tests
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false
on:
workflow_dispatch:
inputs:
node1:
required: true
description: "Node that usually publishes messages. Used for all tests"
type: string
default: "harbor.status.im/wakuorg/go-waku:latest"
node2:
required: true
description: "Node that usually queries for published messages. Used for all tests"
type: string
default: "harbor.status.im/wakuorg/nwaku:latest"
additional_nodes:
required: false
description: "Additional optional nodes used in e2e tests, separated by ,"
type: string
default: "harbor.status.im/wakuorg/nwaku:latest,harbor.status.im/wakuorg/go-waku:latest,harbor.status.im/wakuorg/nwaku:latest"
jobs:
test-common:
uses: ./.github/workflows/test_common.yml
secrets: inherit
with:
node1: ${{ inputs.node1 }}
node2: ${{ inputs.node2 }}
additional_nodes: ${{ inputs.additional_nodes }}

View File

@ -16,6 +16,4 @@ jobs:
with:
node1: "harbor.status.im/wakuorg/nwaku:latest"
node2: "harbor.status.im/wakuorg/nwaku:latest"
caller: "nim"

View File

@ -18,13 +18,17 @@ on:
description: "Additional optional nodes used in e2e tests, separated by ,"
type: string
default: "harbor.status.im/wakuorg/nwaku:latest,harbor.status.im/wakuorg/go-waku:latest,harbor.status.im/wakuorg/nwaku:latest"
caller:
required: false
description: "Workflow caller. Used in reporting"
type: string
env:
FORCE_COLOR: "1"
NODE_1: ${{ inputs.node1 }}
NODE_2: ${{ inputs.node2 }}
ADDITIONAL_NODES: ${{ inputs.additional_nodes }}
CALLER: ${{ inputs.caller || 'manual' }}
jobs:
@ -59,7 +63,7 @@ jobs:
id: allure-report
with:
allure_results: allure-results
gh_pages: gh-pages
gh_pages: gh-pages/${{ env.CALLER }}
allure_history: allure-history
keep_reports: 30
@ -70,6 +74,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history
destination_dir: ${{ env.CALLER }}
- name: Create job summary
if: always()
@ -81,7 +86,7 @@ jobs:
echo "- **Node2**: ${{ env.NODE_2 }}" >> $GITHUB_STEP_SUMMARY
echo "- **Additonal Nodes**: ${{ env.ADDITIONAL_NODES }}" >> $GITHUB_STEP_SUMMARY
echo "## Test Results" >> $GITHUB_STEP_SUMMARY
echo "Allure report will be available at: https://waku-org.github.io/waku-interop-tests/${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY
echo "Allure report will be available at: https://waku-org.github.io/waku-interop-tests/${{ env.CALLER }}/${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY
{
echo 'JOB_SUMMARY<<EOF'
cat $GITHUB_STEP_SUMMARY
@ -90,7 +95,7 @@ jobs:
- name: Send report to Discord
uses: rjstone/discord-webhook-notify@v1
if: always()
if: always() && env.CALLER != 'manual'
with:
severity: ${{ job.status == 'success' && 'info' || 'error' }}
username: ${{ github.workflow }}

View File

@ -25,7 +25,6 @@ NETWORK_NAME = get_env_var("NETWORK_NAME", "waku")
SUBNET = get_env_var("SUBNET", "172.18.0.0/16")
IP_RANGE = get_env_var("IP_RANGE", "172.18.0.0/24")
GATEWAY = get_env_var("GATEWAY", "172.18.0.1")
DEFAULT_PUBSUB_TOPIC = get_env_var("DEFAULT_PUBSUB_TOPIC", "/waku/2/default-waku/proto")
RUNNING_IN_CI = get_env_var("CI")
NODEKEY = get_env_var("NODEKEY", "30348dd51465150e04a5d9d932c72864c8967f806cce60b5d26afeca1e77eb68")
API_REQUEST_TIMEOUT = get_env_var("API_REQUEST_TIMEOUT", 10)

View File

@ -175,7 +175,6 @@ class StepsFilter:
node = self.node2
ping_sub_response = node.ping_filter_subscriptions(request_id)
assert ping_sub_response["requestId"] == request_id
assert ping_sub_response["statusCode"] == 0
assert ping_sub_response["statusDesc"] in ["OK", ""] # until https://github.com/waku-org/nwaku/issues/2286 is fixed
def ping_without_filter_subscription(self, node=None):

View File

@ -122,3 +122,9 @@ class StepsRelay:
message = {"payload": to_base64(self.test_payload), "contentTopic": self.test_content_topic, "timestamp": int(time() * 1e9)}
message.update(kwargs)
return message
@allure.step
@retry(stop=stop_after_delay(30), wait=wait_fixed(1), reraise=True)
def subscribe_and_publish_with_retry(self, node_list, pubsub_topic_list):
self.ensure_relay_subscriptions_on_nodes(node_list, pubsub_topic_list)
self.check_published_message_reaches_relay_peer()

View File

@ -1,8 +1,6 @@
from time import time
from datetime import datetime, timedelta
from src.env_vars import DEFAULT_PUBSUB_TOPIC
NOW = datetime.now()
SAMPLE_INPUTS = [
@ -65,7 +63,7 @@ INVALID_CONTENT_TOPICS = [
{"description": "A bool", "value": True},
]
VALID_PUBSUB_TOPICS = ["/waku/2/rs/0/0", "/waku/2/rs/0/1", "/waku/2/rs/0/9", "/waku/2/rs/0/25", "/waku/2/rs/0/1000", DEFAULT_PUBSUB_TOPIC]
VALID_PUBSUB_TOPICS = ["/waku/2/rs/0/0", "/waku/2/rs/0/1", "/waku/2/rs/0/9", "/waku/2/rs/0/25", "/waku/2/rs/0/1000"]
INVALID_PUBSUB_TOPICS = ["/test/2/rs/0/1", "/waku/3/rs/0/1", "/waku/2/test/0/1", "/waku/2/rs/0/b", "/waku/2/rs/0"]

View File

@ -1,4 +1,5 @@
import pytest
from src.env_vars import NODE_1, NODE_2
from src.libs.common import delay, to_base64
from src.libs.custom_logger import get_custom_logger
from src.test_data import SAMPLE_INPUTS, SAMPLE_TIMESTAMPS
@ -38,9 +39,11 @@ class TestFilterGetMessages(StepsFilter):
def test_filter_get_message_with_version(self):
self.check_published_message_reaches_filter_peer(self.create_message(version=10))
@pytest.mark.xfail("nwaku" in NODE_1 or "nwaku" in NODE_2, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
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.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
def test_filter_get_message_with_ephemeral(self):
failed_ephemeral = []
for ephemeral in [True, False]:
@ -52,6 +55,7 @@ class TestFilterGetMessages(StepsFilter):
failed_ephemeral.append(ephemeral)
assert not failed_ephemeral, f"Ephemeral that failed: {failed_ephemeral}"
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
def test_filter_get_message_with_rate_limit_proof(self):
rate_limit_proof = {
"proof": to_base64("proofData"),
@ -72,6 +76,7 @@ class TestFilterGetMessages(StepsFilter):
except Exception as ex:
assert "Bad Request" in str(ex)
@pytest.mark.xfail("nwaku" in NODE_1, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2320")
def test_filter_get_message_duplicate_message(self):
message = self.create_message()
self.check_published_message_reaches_filter_peer(message)
@ -106,11 +111,13 @@ class TestFilterGetMessages(StepsFilter):
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic])
self.check_published_message_reaches_filter_peer()
@pytest.mark.flaky(reruns=5)
def test_filter_get_50_messages(self):
num_messages = 50
for index in range(num_messages):
message = self.create_message(payload=to_base64(f"M_{index}"))
self.node1.send_relay_message(message, self.test_pubsub_topic)
delay(0.01)
delay(1)
filter_messages = self.get_filter_messages(content_topic=self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node2)
assert len(filter_messages) == num_messages

View File

@ -1,4 +1,5 @@
import pytest
from src.env_vars import NODE_1
from src.libs.common import delay
from src.libs.custom_logger import get_custom_logger
from src.steps.filter import StepsFilter
@ -21,6 +22,7 @@ class TestFilterMultipleNodes(StepsFilter):
self.check_published_message_reaches_filter_peer(peer_list=self.main_nodes)
self.check_publish_without_filter_subscription(peer_list=self.optional_nodes)
@pytest.mark.xfail("nwaku" in NODE_1, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2319")
def test_filter_get_message_while_one_peer_is_paused(self):
self.setup_optional_filter_nodes()
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic])
@ -36,6 +38,7 @@ class TestFilterMultipleNodes(StepsFilter):
filter_messages = self.get_filter_messages(content_topic=self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node2)
assert len(filter_messages) == 2, "Both messages should've been returned"
@pytest.mark.xfail("nwaku" in NODE_1, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2319")
def test_filter_get_message_after_one_peer_was_stopped(self):
self.setup_optional_filter_nodes()
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic])
@ -45,8 +48,8 @@ class TestFilterMultipleNodes(StepsFilter):
self.check_published_message_reaches_filter_peer(peer_list=self.optional_nodes)
def test_ping_only_some_nodes_have_subscriptions(self):
self.setup_optional_filter_nodes()
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic])
self.setup_optional_filter_nodes()
self.ping_filter_subscriptions("1", node=self.node2)
for node in self.optional_nodes:
self.ping_without_filter_subscription(node=node)

View File

@ -1,4 +1,5 @@
import pytest
from src.env_vars import NODE_2
from src.libs.custom_logger import get_custom_logger
from src.test_data import INVALID_CONTENT_TOPICS, SAMPLE_INPUTS, VALID_PUBSUB_TOPICS
from src.steps.filter import StepsFilter
@ -30,6 +31,7 @@ class TestFilterSubscribeCreate(StepsFilter):
self.wait_for_subscriptions_on_main_nodes([self.test_content_topic], pubsub_topic=self.another_cluster_pubsub_topic)
self.check_published_message_reaches_filter_peer(pubsub_topic=self.another_cluster_pubsub_topic)
@pytest.mark.xfail("go-waku" in NODE_2, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2319")
def test_filter_subscribe_to_pubsub_topics_from_multiple_clusters(self):
pubsub_topic_list = [self.test_pubsub_topic, self.another_cluster_pubsub_topic, self.second_pubsub_topic]
failed_pubsub_topics = []
@ -98,7 +100,7 @@ class TestFilterSubscribeCreate(StepsFilter):
self.create_filter_subscription({"requestId": "1", "contentFilters": [self.test_content_topic]})
# raise AssertionError("Subscribe with no pubusub topics worked!!!") commented until https://github.com/waku-org/nwaku/issues/2315 is fixed
except Exception as ex:
assert "Bad Request" in str(ex)
assert "Bad Request" in str(ex) or "timed out" in str(ex)
def test_filter_subscribe_with_invalid_pubsub_topic_format(self, subscribe_main_nodes):
try:

View File

@ -68,7 +68,12 @@ class TestFilterUnSubscribe(StepsFilter):
self.delete_filter_subscription({"requestId": "1", "contentFilters": _101_content_topics, "pubsubTopic": self.test_pubsub_topic})
raise AssertionError("Unsubscribe from more than 100 content topics worked!!!")
except Exception as ex:
assert "exceeds maximum content topics: 100" in str(ex)
if self.node2.is_nwaku():
assert "exceeds maximum content topics: 100" in str(ex)
elif self.node2.is_gowaku():
assert "Bad Request" in str(ex)
else:
raise NotImplementedError("Not implemented for this node type")
def test_filter_unsubscribe_with_no_content_topic(self):
try:

View File

@ -1,4 +1,5 @@
import pytest
from src.env_vars import NODE_1, NODE_2
from src.libs.custom_logger import get_custom_logger
from time import time
from src.libs.common import delay, to_base64
@ -157,6 +158,7 @@ class TestRelayPublish(StepsRelay):
except Exception as ex:
assert "Bad Request" in str(ex)
@pytest.mark.xfail("nwaku" in NODE_1 or "nwaku" in NODE_2, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
def test_publish_with_valid_meta(self):
self.check_published_message_reaches_relay_peer(self.create_message(meta=to_base64(self.test_payload)))
@ -167,6 +169,7 @@ class TestRelayPublish(StepsRelay):
except Exception as ex:
assert "Bad Request" in str(ex)
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
def test_publish_with_ephemeral(self):
failed_ephemeral = []
for ephemeral in [True, False]:
@ -178,6 +181,7 @@ class TestRelayPublish(StepsRelay):
failed_ephemeral.append(ephemeral)
assert not failed_ephemeral, f"Ephemeral that failed: {failed_ephemeral}"
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
def test_publish_with_rate_limit_proof(self):
rate_limit_proof = {
"proof": to_base64("proofData"),
@ -231,9 +235,7 @@ class TestRelayPublish(StepsRelay):
self.check_published_message_reaches_relay_peer()
self.node1.restart()
self.node1.ensure_ready()
delay(2)
self.ensure_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic])
self.check_published_message_reaches_relay_peer()
self.subscribe_and_publish_with_retry(self.main_nodes, [self.test_pubsub_topic])
def test_publish_after_node2_restarts(self):
self.check_published_message_reaches_relay_peer()
@ -242,6 +244,7 @@ class TestRelayPublish(StepsRelay):
self.ensure_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic])
self.wait_for_published_message_to_reach_relay_peer()
@pytest.mark.flaky(reruns=5)
def test_publish_and_retrieve_100_messages(self):
num_messages = 100 # if increase this number make sure to also increase rest-relay-cache-capacity flag
for index in range(num_messages):

View File

@ -1,5 +1,4 @@
import pytest
from src.env_vars import DEFAULT_PUBSUB_TOPIC
from src.libs.custom_logger import get_custom_logger
from src.steps.relay import StepsRelay
from src.test_data import INVALID_PUBSUB_TOPICS, VALID_PUBSUB_TOPICS
@ -99,12 +98,3 @@ class TestRelaySubscribe(StepsRelay):
self.check_publish_without_relay_subscription(self.test_pubsub_topic)
self.ensure_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic])
self.check_published_message_reaches_relay_peer()
def test_relay_publish_on_default_pubsub_topic_without_beeing_subscribed_to_it(self):
self.ensure_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic])
self.wait_for_published_message_to_reach_relay_peer()
try:
self.check_published_message_reaches_relay_peer(pubsub_topic=DEFAULT_PUBSUB_TOPIC)
raise AssertionError(f"Publish on {DEFAULT_PUBSUB_TOPIC} with beeing subscribed to it worked!!!")
except Exception as ex:
assert "Not Found" in str(ex)