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

test(peer-connection-managenent): Functional Tests #2321

Merged
merged 7 commits into from
Jan 5, 2024

Conversation

AlejandroCabeza
Copy link
Contributor

@AlejandroCabeza AlejandroCabeza commented Dec 27, 2023

Description

Peer Connection Management Tests

Changes

  • Add simple mock mechanism
  • Implement migration tests
  • Peer Storage tests
  • Simple Protobuf serialisation tests
    • Expanding these will be left for a later date due to a priority shift.

@AlejandroCabeza AlejandroCabeza self-assigned this Dec 27, 2023
@AlejandroCabeza AlejandroCabeza changed the title Test peer mgmt test(peer-connection-managenent): Peer Connection Management Functional Tests Dec 27, 2023
@AlejandroCabeza AlejandroCabeza changed the title test(peer-connection-managenent): Peer Connection Management Functional Tests test(peer-connection-managenent): Functional Tests Dec 27, 2023
Copy link

github-actions bot commented Dec 27, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2321

Built from 3d2eefe

@AlejandroCabeza AlejandroCabeza changed the title test(peer-connection-managenent): Functional Tests test(peer-connection-managenent): Functional Tests Dec 28, 2023
@AlejandroCabeza AlejandroCabeza changed the base branch from master to test-autosharding January 4, 2024 11:16
@AlejandroCabeza AlejandroCabeza marked this pull request as ready for review January 4, 2024 11:17
Copy link
Contributor

@SionoiS SionoiS left a comment

Choose a reason for hiding this comment

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

I'm not sure I understand the point in mocking the migration.

If the mock returns ok and the test check for ok then obviously it's going to work no?

Otherwise LGTM

tests/node/peer_manager/peer_store/test_migrations.nim Outdated Show resolved Hide resolved
tests/node/peer_manager/peer_store/test_migrations.nim Outdated Show resolved Hide resolved
Base automatically changed from test-autosharding to master January 4, 2024 15:26
@AlejandroCabeza
Copy link
Contributor Author

I'm not sure I understand the point in mocking the migration.

If the mock returns ok and the test check for ok then obviously it's going to work no?

Otherwise LGTM

The idea is to test the top-level migrate only, not the db_sqlite.migrate. For this particular instance, I don't care (and don't have the specifics) about the internals of what happens when a migration occurs: What files are created, in which format, what errors may be triggered. The top-level function's only a wrapper to provide a different (better?) error handling, and that's precisely what I wanna test: That the top-level function behaves as expected for the different results of db_sqlite.migrate.

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you! :))

tests/node/peer_manager/peer_store/test_migrations.nim Outdated Show resolved Hide resolved
@AlejandroCabeza AlejandroCabeza merged commit e9d083b into master Jan 5, 2024
6 of 8 checks passed
@AlejandroCabeza AlejandroCabeza deleted the test-peer-mgmt branch January 5, 2024 13:49
NagyZoltanPeter added a commit that referenced this pull request Jan 7, 2024
…introduced build error through ambigous function call, testwaku build failed on master
NagyZoltanPeter added a commit that referenced this pull request Jan 8, 2024
…introduced build error through ambigous function call, testwaku build failed on master (#2337)
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