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

Tested examples in src/lib.rs Rustdocs #70

Closed
Hoverbear opened this issue May 31, 2018 · 4 comments · Fixed by #289
Closed

Tested examples in src/lib.rs Rustdocs #70

Hoverbear opened this issue May 31, 2018 · 4 comments · Fixed by #289
Labels
Good First Issue A good issue for a new contributor. Help Wanted An issue with unsolved problems, looking for help.

Comments

@Hoverbear
Copy link
Contributor

Hoverbear commented May 31, 2018

#69 introduces examples for usage to src/lib.rs. However most of them are not actually compiled or tested.

We would like them to remove the ignore from the code fences so the examples are tested.

Please use hiding in the examples to keep the redundant setup code from getting in the way.

@Hoverbear is very happy to help mentor this issue. Just ping. :)

@KeeganMyers
Copy link

@Hoverbear this will be my first PR in the Rust ecosystem, but I would be willing to give this a shot over the coming weekend 02/16-02/17.

@Hoverbear
Copy link
Contributor Author

@KeeganMyers Oh, amazing! What an honor. 🙇‍♀️

I'll make sure to keep an eye on this issue over the weekend. Let me know how I can help. Progress one or more examples would be a great PR. :)

The API can be a bit confusing, feel encouraged to ask questions.

@KeeganMyers
Copy link

Sorry for the delay I have added hidden boilerplate to make all the examples pass. I did note that in the integration tests there are several errors:

test integration_cases::test_raft_paper::test_leader_election_in_one_round_rpc ... ok
ERROR 2019-02-21T23:05:57Z: raft::raft: invalid format of MsgReadIndexResp from 0, entries count: 0

test integration_cases::test_raft_snap::test_snapshot_succeed ... ok
ERROR 2019-02-21T23:05:57Z: raft::raft: The node 1 already exists in the voters set.
ERROR 2019-02-21T23:05:57Z: raft::raft: The node 1 already exists in the voters set.

test integration_cases::test_raft::test_restore_learner_promotion ... ok
ERROR 2019-02-21T23:05:57Z: raft::raft: can't become learner when restores snapshot [index: 11, term: 11]

test integration_cases::test_raft::test_add_node_check_quorum ... ok
ERROR 2019-02-21T23:05:57Z: raft::raft: The node 1 already exists in the voters set.

Should I explore and resolve these or are they outside of the scope of this issue?

@Hoverbear
Copy link
Contributor Author

@KeeganMyers Those are expected errors where we are testing to make sure Raft properly reports the error. It's ok. :) If you see the cargo test output report at the end there was a failure, then the tests failed, otherwise you don't need to worry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue A good issue for a new contributor. Help Wanted An issue with unsolved problems, looking for help.
Projects
None yet
2 participants