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(gateway): test RpcStateReader #449

Merged
merged 1 commit into from
Jul 14, 2024
Merged

Conversation

yair-starkware
Copy link
Contributor

@yair-starkware yair-starkware commented Jul 11, 2024

This change is Reviewable

@yair-starkware yair-starkware self-assigned this Jul 11, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.78%. Comparing base (73bf292) to head (f4af82a).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #449      +/-   ##
==========================================
+ Coverage   83.13%   83.78%   +0.65%     
==========================================
  Files          37       37              
  Lines        1737     1819      +82     
  Branches     1737     1819      +82     
==========================================
+ Hits         1444     1524      +80     
- Misses        214      220       +6     
+ Partials       79       75       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dafnamatsry dafnamatsry left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 6 files at r1, all commit messages.
Reviewable status: 5 of 6 files reviewed, 2 unresolved discussions (waiting on @yair-starkware)


crates/gateway/src/rpc_state_reader_test.rs line 30 at r1 (raw file):

        "params": json!(params),
    }));
    dbg!(serde_json::to_string(&expected_response).unwrap());

needed?

Code quote:

dbg!(serde_json::to_string(&expected_response).unwrap());

crates/gateway/src/rpc_state_reader_test.rs line 74 at r1 (raw file):

        let block_info = client.get_block_info().unwrap();
        // TODO(yair): Add partial_eq for BlockInfo and assert_eq the whole BlockInfo.
        assert_eq!(block_info.block_number, BlockNumber(100));

Can we move the assertion outside of the spawn_blocking?
A bit more readable IMO to have all the assertions of the test last. Also, not sure how the a failure inside the spawn_blocking is presented when running the test...

Code quote:

assert_eq!(block_info.block_number, BlockNumber(100));

@yair-starkware yair-starkware force-pushed the yair/rpc_state_reader_tests branch 2 times, most recently from 4062595 to 654604e Compare July 14, 2024 10:29
@yair-starkware yair-starkware force-pushed the yair/rpc_state_reader_tests branch from 654604e to f4af82a Compare July 14, 2024 11:23
Copy link
Contributor Author

@yair-starkware yair-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 6 files reviewed, 2 unresolved discussions (waiting on @dafnamatsry)


crates/gateway/src/rpc_state_reader_test.rs line 30 at r1 (raw file):

Previously, dafnamatsry wrote…

needed?

Removed


crates/gateway/src/rpc_state_reader_test.rs line 74 at r1 (raw file):

Previously, dafnamatsry wrote…

Can we move the assertion outside of the spawn_blocking?
A bit more readable IMO to have all the assertions of the test last. Also, not sure how the a failure inside the spawn_blocking is presented when running the test...

Done.

Copy link
Collaborator

@dafnamatsry dafnamatsry left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 3 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @yair-starkware)

@yair-starkware yair-starkware merged commit 26074b1 into main Jul 14, 2024
8 checks passed
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