This repository was archived by the owner on Apr 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 - uses : actions/setup-go@v2
1616 with :
1717 go-version : ' ^1.15.6'
18+ - name : Running test suite
19+ run : make test
1820 - name : Building release binaries
1921 run : make release
2022 - name : Creating Release
Original file line number Diff line number Diff line change 11BINARY =pcp
2- VERSION =0.3.0
2+ VERSION =0.3.1
33BUILD =` git rev-parse HEAD `
44PLATFORMS =darwin linux windows
55ARCHITECTURES =386 amd64 arm
@@ -11,6 +11,9 @@ default: build
1111
1212all : clean release install
1313
14+ test :
15+ go test ./...
16+
1417build :
1518 go build ${LDFLAGS} -o out/${BINARY} cmd/pcp/pcp.go
1619
Original file line number Diff line number Diff line change 66 "testing"
77 "time"
88
9+ mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
10+
911 "github.com/golang/mock/gomock"
1012 "github.com/ipfs/go-cid"
1113 "github.com/libp2p/go-libp2p-core/peer"
@@ -182,7 +184,10 @@ func TestDiscoverer_Discover_restartAsSoonAsCurrentTimeSlotIsExpired(t *testing.
182184}
183185
184186func TestDiscoverer_SetOffset (t * testing.T ) {
185- d := NewDiscoverer (nil , nil )
187+ net := mocknet .New (context .Background ())
188+ local , err := net .GenPeer ()
189+ require .NoError (t , err )
190+ d := NewDiscoverer (local , nil )
186191 id1 := d .DiscoveryID (333 )
187192 d .SetOffset (TruncateDuration * 3 )
188193 id2 := d .DiscoveryID (333 )
You can’t perform that action at this time.
0 commit comments