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

feat: add Makefile to easy fix-lint and test in local #751

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hoank101
Copy link
Contributor

Closes: #XXX


PR author checklist

For all contributors

For external contributors

Copy link

codecov bot commented Jan 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.53%. Comparing base (304c8ee) to head (6241f7c).
Report is 49 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #751      +/-   ##
==========================================
- Coverage   79.28%   75.53%   -3.76%     
==========================================
  Files         104      165      +61     
  Lines        9026    14301    +5275     
==========================================
+ Hits         7156    10801    +3645     
- Misses       1870     3500    +1630     
Flag Coverage Δ
integration 75.53% <ø> (-3.47%) ⬇️
mbt ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated
cd code && cargo clippy --fix --allow-dirty --workspace -- -D warnings

test:
cd code && cargo test
Copy link
Member

Choose a reason for hiding this comment

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

For running unit tests, I would advise using https://nexte.st as it's a much more capable test runner than the builtin test command.

For integration tests, we use cargo-maelstrom to isolate each test and run them in parallel.

So let's perhaps add two targets: integration-tests and unit-tests and combine them under test.

Copy link
Member

Choose a reason for hiding this comment

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

See the corresponding GitHub Action workflows for more details:

Copy link
Member

Choose a reason for hiding this comment

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

I will update the CONTRIBUTING.md file accordingly to better surface this information.

Copy link
Contributor Author

@hoank101 hoank101 Jan 13, 2025

Choose a reason for hiding this comment

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

i updated, but will add integration-tests, currently cargo-maelstrom don't work well on MacOs

Copy link
Member

Choose a reason for hiding this comment

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

Ah right, then we can instead use cargo nextest -p informalsystems-malachitebft-starknet-test --no-capture which works on all platforms.

Makefile Outdated Show resolved Hide resolved
@@ -16,6 +16,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
config.bytes(["."]);
config.enable_type_names();
config.default_package_filename("p2p");
config.disable_comments(["."]); // This will disable doc comments generation
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed? Have you seen issues with the generated doc comments?

Copy link
Contributor Author

@hoank101 hoank101 Jan 13, 2025

Choose a reason for hiding this comment

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

i added because have warning

warning: first doc comment paragraph is too long
    --> /Users/xx/resource/malachite/code/target/debug/build/informalsystems-malachitebft-starknet-p2p-proto-5e678345c56c8f38/out/p2p.rs:1295:1
     |
1295 | / /// Finalize the Tendermint Proposal. When a validator receives this message it will presume that no
1296 | | /// more content for the proposal should be sent. The signature supplied with ProposalFin should be
1297 | | /// for the full Tendermint proposal:

Copy link
Member

Choose a reason for hiding this comment

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

How do you get this warning? With rustfmt or clippy?

@hoank101 hoank101 requested a review from romac January 13, 2025 14:23
code/Makefile Show resolved Hide resolved
@romac romac added the code Code/implementation related label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code/implementation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants