Skip to content

Commit

Permalink
Merge pull request ipfs/go-blockservice#52 from ipfs/fix/circleci-badge
Browse files Browse the repository at this point in the history
fix ci badge and lints

This commit was moved from ipfs/go-blockservice@d582f74
  • Loading branch information
Stebalien authored Mar 23, 2020
2 parents d51e93e + af6b9cf commit d952f53
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion blockservice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go-blockservice
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![Coverage Status](https://codecov.io/gh/ipfs/go-block-format/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/go-block-format/branch/master)
[![Travis CI](https://travis-ci.com/ipfs/go-blockservice.svg?branch=master)](https://travis-ci.com/ipfs/go-blockservice)
[![Build Status](https://circleci.com/gh/ipfs/go-blockservice.svg?style=svg)](https://circleci.com/gh/ipfs/go-blockservice)

> go-blockservice provides a seamless interface to both local and remote storage backends.
Expand Down
21 changes: 16 additions & 5 deletions blockservice/blockservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ func TestWriteThroughWorks(t *testing.T) {
block := bgen.Next()

t.Logf("PutCounter: %d", bstore.PutCounter)
bserv.AddBlock(block)
err := bserv.AddBlock(block)
if err != nil {
t.Fatal(err)
}
if bstore.PutCounter != 1 {
t.Fatalf("expected just one Put call, have: %d", bstore.PutCounter)
}

bserv.AddBlock(block)
err = bserv.AddBlock(block)
if err != nil {
t.Fatal(err)
}
if bstore.PutCounter != 2 {
t.Fatalf("Put should have called again, should be 2 is: %d", bstore.PutCounter)
}
Expand All @@ -52,10 +58,15 @@ func TestLazySessionInitialization(t *testing.T) {
bgen := butil.NewBlockGenerator()

block := bgen.Next()
bstore.Put(block)

err := bstore.Put(block)
if err != nil {
t.Fatal(err)
}
block2 := bgen.Next()
session.HasBlock(block2)
err = session.HasBlock(block2)
if err != nil {
t.Fatal(err)
}

bsession := NewSession(ctx, bservSessEx)
if bsession.ses != nil {
Expand Down
5 changes: 4 additions & 1 deletion blockservice/test/blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ func TestGetBlocksSequential(t *testing.T) {
var cids []cid.Cid
for _, o := range objs {
cids = append(cids, o.Cid())
servs[0].AddBlock(o)
err := servs[0].AddBlock(o)
if err != nil {
t.Fatal(err)
}
}

t.Log("one instance at a time, get blocks concurrently")
Expand Down

0 comments on commit d952f53

Please sign in to comment.