Skip to content

Conversation

@AYAHASSAN287
Copy link
Collaborator

@AYAHASSAN287 AYAHASSAN287 commented Oct 15, 2024

PR Details

  • store v3 edge cases

Issues reported:

@AYAHASSAN287 AYAHASSAN287 marked this pull request as draft October 15, 2024 06:38
@AYAHASSAN287 AYAHASSAN287 marked this pull request as ready for review October 15, 2024 10:10
Copy link
Collaborator

@fbarbu15 fbarbu15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left minor comments
Please review the logs, I think they could be better

logger.debug(f"logger is {wrong_peer_addr}")
try:
self.check_published_message_is_stored(store_node=self.store_node1, peer_addr=wrong_peer_addr)
raise Exception("message restored with wrong peer address")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo : restored

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also let's please capitalize logs, this is a general comment

def test_store_with_wrongPeerAddr(self):
self.publish_message()
wrong_peer_addr = self.multiaddr_list[0][1:]
logger.debug(f"logger is {wrong_peer_addr}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a better log would be:
f"Running test with wrong_peer_addr: {wrong_peer_addr}"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


def test_store_not_include_data(self):
message = self.create_message()
self.publish_message(message=message)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case where we don't use message in any other place I think it's better to use directly:
self.publish_message(message=self.create_message())
makes test more succint

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@AYAHASSAN287 AYAHASSAN287 marked this pull request as draft October 15, 2024 12:31
@AYAHASSAN287 AYAHASSAN287 marked this pull request as ready for review October 16, 2024 11:34
@AYAHASSAN287 AYAHASSAN287 requested a review from fbarbu15 October 16, 2024 11:34
return None

def message_payload(self, index):
def message_content(self, index):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method was used in other places, please either:

  • create a new method and leave message_payload
  • update any other places where message_payload was used to use message_content

logger.debug(f" Message restored with hash only is {store_response.messages} ")
assert "message" not in store_response.messages

def test_get_store_messages_with_different_pubsub_topics11(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.error(f"Topic {wrong_topic} is wrong ''n: {str(e)}")
assert e.args[0].find("messages': []") != -1, "Message shall not be stored for wrong topic"

def test_get_store_messages_with_content_topic(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def test_get_store_messages_with_content_topic(self):
# positive scenario
content_topic = "/myapp/1/latest/protoo"
message = {"payload": to_base64(self.test_payload), "" "contentTopic": content_topic, "timestamp": int(time() * 1e9)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use create_message ex
message = self.create_message(contentTopic=content_topic)

@AYAHASSAN287 AYAHASSAN287 marked this pull request as draft October 16, 2024 15:52
@AYAHASSAN287 AYAHASSAN287 marked this pull request as ready for review October 22, 2024 09:01
@AYAHASSAN287 AYAHASSAN287 requested a review from fbarbu15 October 22, 2024 09:01
Copy link
Collaborator

@fbarbu15 fbarbu15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AYAHASSAN287 AYAHASSAN287 merged commit bd187ad into master Oct 24, 2024
1 check passed
@AYAHASSAN287 AYAHASSAN287 deleted the WAKU_edge_tests branch October 24, 2024 10:16
@fbarbu15
Copy link
Collaborator

@AYAHASSAN287 can you please update the PR name and description, saying what was added?
I also saw that you closed the other 2 PRs and added those changes into this one.
I think it's better to have 3 separate smaller PRs, since you already created them. No need to do anything now, but just wanted to tell you that in the future there is no need to do the merging of PRs into a single one.
Thanks

@fbarbu15
Copy link
Collaborator

@AYAHASSAN287 I also just noticed that you didn't run the tests in the CI.
Before merging any PR we need to check that it doesn't break the CI execution.
We can run the github actions manually like this

image

@fbarbu15
Copy link
Collaborator

@AYAHASSAN287 not sure if you are aware but those tests are running in CI under 2 workflows:

  • nim -> nim ( which basically means that in .env file we would have NODE_1="wakuorg/nwaku:latest" NODE_2="wakuorg/nwaku:latest")
  • nim -> go ( which basically means that in .env file we would have NODE_1="wakuorg/nwaku:latest" NODE_2="wakuorg/go-waku:latest")

Did you tested your new tests with both flows? If they pass you don't need to do anything. but if they fail on nim -> go, they need either adjusting or skipping

@fbarbu15 fbarbu15 changed the title adding test "test_store_not_include_data" Chore: store v3 edge test cases Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants