Comments (12)
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.
from go-libp2p.
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 go-libp2p-swarm
, go-libp2p-kad-dht
, and go-libp2p-transport
.
from go-libp2p.
Hi, I'm trying to run test.
In the code package imports are prefixed with github.com/libp2p/go-libp2p
. Why not github.com/libp2p/go-libp2p
? What am I missing?
Here is what I am referring to https://github.com/libp2p/go-libp2p/blob/master/p2p/discovery/mdns.go#L18
from go-libp2p.
There seems to be both github.com/ipfs/go-libp2p
and github.com/libp2p/go-libp2p
?
from go-libp2p.
We're in the middle of moving the libp2p code from the ipfs org to the new
libp2p org. Each package has to be moved manually and updated, we just
haven't gotten around to it yet. This doesn't currently cause any problems
for the code
On Wed, Aug 17, 2016, 07:10 zjiekai [email protected] wrote:
There seems to be both github.com/ipfs/go-libp2p and
github.com/libp2p/go-libp2p?—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#83 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABL4HOJphZ6Y9VCeQsru3r960x9SwvB-ks5qgxZngaJpZM4JgUOS
.
from go-libp2p.
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 $GOPATH/src/github.com/libp2p/go-libp2p
? Or are there some magic that make the go
command work? I'd really like to learn the trick to run the code if that's not too much trouble.
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 go get github.com/libp2p/go-libp2p
in the first place.
from go-libp2p.
@zjiekai did you get it working? If you provide me with the error messages of things going wrong I can be more helpful
from go-libp2p.
@zjiekai also, an aside, i'm super excited for DEVCON 2 :)
from go-libp2p.
To run the tests for go-libp2p, i would do the following:
First, get the code and deps:
go get -d github.com/libp2p/go-libp2p
cd $GOPATH/src/github.com/libp2p/go-libp2p
make deps
gx-go rewrite
Now, you're set to run the tests, to run all of them, do:
go test ./...
To run tests for a specific package, do:
go test ./p2p/net/swarm
You can add -v
for more verbose information, and -cover
for code coverage information:
go test -v -cover ./...
go test -v -cover ./p2p/net/mock
you can also generate html coverage reports by doing:
go test -v -coverprofile=cover.out ./p2p/net/swarm
go tool cover -html=cover.out
Then, before you commit anything, make sure to undo all the import path changes:
gx-go rewrite --undo
Let me know if i missed anything!
from go-libp2p.
@whyrusleeping It's working now. Thank you for the detailed write up. Super helpful!
from go-libp2p.
@zjiekai awesome! Please let me know if you run into any other issues or have any questions
from go-libp2p.
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.
from go-libp2p.
Related Issues (20)
- How to Add the Ed448-Goldilocks elliptic curve to the project HOT 2
- go-libp2p v0.33 HOT 1
- bug(share/discovery): discovey should not retry lookup if it has found enough peers HOT 1
- Question: rcmgr limit conflicts with connmgr limit HOT 12
- Excessive thread creation HOT 3
- Is there to be an example about hole-punching? HOT 25
- How to set limits properly HOT 4
- High network usage HOT 10
- Peer Discovery Fail HOT 1
- Peerstore reports empty protocolID list HOT 18
- Can quic.Transport be directly connected? HOT 13
- `p2p/security/tls`: does not handle simultaneous closes HOT 3
- version 0.32.1 mdns issue HOT 4
- WebRTC: Tracking Issue HOT 2
- Make WebRTC non experimental HOT 1
- proper support for IPv6 link-local addresses HOT 7
- go-libp2p-asn-util adds ~4MiB to builds and increases build times, even in configurations where it will never be used HOT 5
- 如何搭建dht服务器,没有找到相关的代码,请问有没有热心大佬给个地址或者方法 HOT 3
- Auto Relay Doesn't Work in libp2p Network HOT 2
- Use the same port for TCP and WebSocket HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-libp2p.