Unverified Commit 444faec0 authored by Hannah Howard's avatar Hannah Howard Committed by GitHub

Merge pull request #34 from ipfs/feat/add-travis

ci(travis): add travis.yml
parents ec235713 f07e2e65
os:
- linux
language: go
go:
- 1.11.x
env:
global:
- GOTFLAGS="-race"
matrix:
- BUILD_DEPTYPE=gomod
# disable travis install
install:
- true
script:
- bash <(curl -s https://raw.githubusercontent.com/ipfs/ci-helpers/master/travis-ci/run-standard-tests.sh)
cache:
directories:
- $GOPATH/src/gx
- $GOPATH/pkg/mod
- $HOME/.cache/go-build
notifications:
email: false
...@@ -14,8 +14,8 @@ import ( ...@@ -14,8 +14,8 @@ import (
"github.com/ipfs/go-graphsync/requestmanager" "github.com/ipfs/go-graphsync/requestmanager"
"github.com/ipfs/go-graphsync/responsemanager" "github.com/ipfs/go-graphsync/responsemanager"
"github.com/ipfs/go-graphsync/responsemanager/peerresponsemanager" "github.com/ipfs/go-graphsync/responsemanager/peerresponsemanager"
"github.com/ipfs/go-peertaskqueue"
logging "github.com/ipfs/go-log" logging "github.com/ipfs/go-log"
"github.com/ipfs/go-peertaskqueue"
ipld "github.com/ipld/go-ipld-prime" ipld "github.com/ipld/go-ipld-prime"
"github.com/libp2p/go-libp2p-peer" "github.com/libp2p/go-libp2p-peer"
) )
......
...@@ -12,9 +12,9 @@ import ( ...@@ -12,9 +12,9 @@ import (
cid "github.com/ipfs/go-cid" cid "github.com/ipfs/go-cid"
gsmsg "github.com/ipfs/go-graphsync/message" gsmsg "github.com/ipfs/go-graphsync/message"
"github.com/ipfs/go-graphsync/responsemanager/peerresponsemanager" "github.com/ipfs/go-graphsync/responsemanager/peerresponsemanager"
"github.com/ipfs/go-peertaskqueue/peertask"
"github.com/ipfs/go-graphsync/testbridge" "github.com/ipfs/go-graphsync/testbridge"
"github.com/ipfs/go-graphsync/testutil" "github.com/ipfs/go-graphsync/testutil"
"github.com/ipfs/go-peertaskqueue/peertask"
ipld "github.com/ipld/go-ipld-prime" ipld "github.com/ipld/go-ipld-prime"
cidlink "github.com/ipld/go-ipld-prime/linking/cid" cidlink "github.com/ipld/go-ipld-prime/linking/cid"
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-peer"
...@@ -222,31 +222,33 @@ func TestCancellationQueryInProgress(t *testing.T) { ...@@ -222,31 +222,33 @@ func TestCancellationQueryInProgress(t *testing.T) {
responseManager.synchronize() responseManager.synchronize()
// read one block -- to unblock processing // at this point we should receive at most one more block, then traversal
select { // should complete
case sentResponse := <-sentResponses: additionalMessageCount := 0
k := sentResponse.link.(cidlink.Link) drainqueue:
blockIndex := testutil.IndexOf(blks, k.Cid) for {
if blockIndex == -1 { select {
t.Fatal("sent incorrect link") case <-ctx.Done():
} t.Fatal("Should have completed request but didn't")
if !reflect.DeepEqual(sentResponse.data, blks[blockIndex].RawData()) { case sentResponse := <-sentResponses:
t.Fatal("sent incorrect data") if additionalMessageCount > 0 {
} t.Fatal("should not send any more responses")
if sentResponse.requestID != requestID { }
t.Fatal("incorrect response id") k := sentResponse.link.(cidlink.Link)
blockIndex := testutil.IndexOf(blks, k.Cid)
if blockIndex == -1 {
t.Fatal("sent incorrect link")
}
if !reflect.DeepEqual(sentResponse.data, blks[blockIndex].RawData()) {
t.Fatal("sent incorrect data")
}
if sentResponse.requestID != requestID {
t.Fatal("incorrect response id")
}
additionalMessageCount++
case <-requestIDChan:
break drainqueue
} }
case <-ctx.Done():
t.Fatal("did not send responses")
}
// at this point traversal should abort and we should receive a completion
select {
case <-ctx.Done():
t.Fatal("Should have completed request but didn't")
case <-sentResponses:
t.Fatal("should not send any more responses")
case <-requestIDChan:
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment