-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Hit >80% code coverage on all libp2p packages #83
Comments
Hi, I'm trying to run test. In the code package imports are prefixed with Here is what I am referring to https://github.com/libp2p/go-libp2p/blob/master/p2p/discovery/mdns.go#L18 |
There seems to be both |
We're in the middle of moving the libp2p code from the ipfs org to the new On Wed, Aug 17, 2016, 07:10 zjiekai notifications@github.com wrote:
|
It's probably my lack of experience with golang getting me really confused. Should I wait for the transition settled? Or should I just make a copy and edit the code in There will be a a talk about IPFS in devcon in China. I'm trying to get started so if I get a chance to meet the IPFS guys I can ask some meaningful questions update: I see. I should run |
@zjiekai did you get it working? If you provide me with the error messages of things going wrong I can be more helpful |
@zjiekai also, an aside, i'm super excited for DEVCON 2 :) |
To run the tests for go-libp2p, i would do the following: First, get the code and deps:
Now, you're set to run the tests, to run all of them, do:
To run tests for a specific package, do:
You can add
you can also generate html coverage reports by doing:
Then, before you commit anything, make sure to undo all the import path changes:
Let me know if i missed anything! |
@whyrusleeping It's working now. Thank you for the detailed write up. Super helpful! |
@zjiekai awesome! Please let me know if you run into any other issues or have any questions |
I'd like to contribute to this effort. Just opened libp2p/go-libp2p-loggables#21 to kick things off. Anything I should keep in mind while writing tests? Special mocking frameworks you use or general guidelines I should follow? I'll start with the utilities/miscellaneous repos as they're generally less intimidating and I'll open issues in the respective repos if I have questions. |
We generally just use the standard go testing library without any additional testing frameworks. The best way to learn how we write tests is to look at the tests in |
This issue hasn't really helped motivate us to improve test coverage, although test coverage has been steadily getting better. So I'm going to close it. |
fix: avoid logging "invalid argument" errors when setting keepalive
add the peer ID to SecureInbound
Similar to ipfs/kubo#3053 we want to have really good test coverage on libp2p. Its the core on which ipfs and other future applications rest, and if libp2p doesn't work, the apps on top of it don't stand much of a chance. Here is a list of all the libp2p package (in this repo and outside of this repo) that we need to have coverage for:
The text was updated successfully, but these errors were encountered: