Skip to content

Commit

Permalink
build: enable code coverage, update travis.yml and Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
petroav committed Jan 23, 2019
1 parent 1b43d1b commit a37b1b1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
sudo: false
os:
- linux
- osx

language: go

go:
- 1.9.x
- 1.11.x

install:
before_install:
- make deps

script:
- bash <(curl -s https://raw.githubusercontent.com/ipfs/ci-helpers/master/travis-ci/run-standard-tests.sh)

cache:
directories:
- $GOPATH/src/gx
directories:
- $GOPATH/src/gx

notifications:
email: false

env: GOTFLAGS="-race"
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gx:
go get github.com/whyrusleeping/gx
go get github.com/whyrusleeping/gx-go

deps: gx
gx --verbose install --global
gx-go rewrite

publish:
gx-go rewrite --undo
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage:
range: "50...100"
comment: off
2 changes: 1 addition & 1 deletion pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestAllocations(t *testing.T) {
runtime.GC()
runtime.ReadMemStats(&m2)
frees := m2.Frees - m1.Frees
if frees > 100 {
if frees > 1000 {
t.Fatalf("expected less than 100 frees after GC, got %d", frees)
}
}
Expand Down

0 comments on commit a37b1b1

Please sign in to comment.