Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: new filter tests #1552

Merged
merged 10 commits into from
Sep 12, 2023
Merged

chore: new filter tests #1552

merged 10 commits into from
Sep 12, 2023

Conversation

fbarbu15
Copy link
Collaborator

@fbarbu15 fbarbu15 commented Sep 11, 2023

Problem

After reviewing the filter tests found the following problems:

  • Only had 6 automated tests
  • Asserts inside callbacks were not working (not failing tests)
  • BeforeEach code was sometimes failing when starting docker containers
  • There was no reusable functions in regards with checking messages and doing asserts

Solution

Added PR with following fixes:

  • Reached 65 automated tests
  • Moved asserts out of the callbacks so that they work properly now
  • Added retries on failing code from before each
  • Added some reusable functions regarding message collection and validation

Notes

  • There's a test that randomly fails and left it skipped for now. Not sure if I implemented it badly or it's an actual issue (known or not): Subscribe and receive messages from multiple nwaku nodes
  • There are 2 failing tests that are skipped and related to: Peer Management: Automated actions upon reconnection #1464

@github-actions
Copy link

github-actions bot commented Sep 11, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku core 28.79 KB (0%) 576 ms (0%) 545 ms (-1.36% 🔽) 1.2 s
Waku Simple Light Node 309.78 KB (0%) 6.2 s (0%) 1.2 s (+23.3% 🔺) 7.4 s
ECIES encryption 28.68 KB (0%) 574 ms (0%) 487 ms (+8.85% 🔺) 1.1 s
Symmetric encryption 28.68 KB (0%) 574 ms (0%) 368 ms (-22.71% 🔽) 942 ms
DNS discovery 118.59 KB (0%) 2.4 s (0%) 558 ms (+10.64% 🔺) 3 s
Privacy preserving protocols 122.6 KB (0%) 2.5 s (0%) 708 ms (+22.73% 🔺) 3.2 s
Light protocols 29.22 KB (0%) 585 ms (0%) 326 ms (-12.01% 🔽) 910 ms
History retrieval protocols 28.34 KB (0%) 567 ms (0%) 275 ms (-11.59% 🔽) 842 ms
Deterministic Message Hashing 5.64 KB (0%) 113 ms (0%) 114 ms (-48.13% 🔽) 227 ms

@fbarbu15 fbarbu15 changed the title Chore/new filter tests chore: new filter tests Sep 11, 2023
@fbarbu15 fbarbu15 marked this pull request as ready for review September 11, 2023 12:26
@fbarbu15 fbarbu15 requested a review from a team as a code owner September 11, 2023 12:26
});

it("Subscribe and receive messages via lightPush", async function () {
// Subscribe to the content topic and set callback for received messages.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's good to have comments but to me it seems we can drop some of them sicne it is clear what's happening by the code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, will remove some of them :)

@@ -2,7 +2,9 @@ import {
createDecoder,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Amazing job! I have only one comment here - the file is huge now.
I propose to break it into some files under filter folder.

Copy link
Collaborator Author

@fbarbu15 fbarbu15 Sep 12, 2023

Choose a reason for hiding this comment

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

Yes, makes sense, I'll create a folder with multiple files based on features:

  • subscribe
  • ping
  • unsubscribe
  • filterPush
  • filterTestUtils

Makes sense?

@fbarbu15
Copy link
Collaborator Author

@weboko thanks for the review! Can you also please merge it :) ?

@weboko weboko merged commit b42601d into master Sep 12, 2023
9 of 10 checks passed
@weboko weboko deleted the chore/new-filter-tests branch September 12, 2023 21:31
@fbarbu15 fbarbu15 added the E:End-to-end testing See https://github.com/waku-org/pm/issues/34 for details label Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:End-to-end testing See https://github.com/waku-org/pm/issues/34 for details
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants