Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Makefile for easy running of tests and coverage. #12

Merged
merged 1 commit into from
Apr 16, 2019

Conversation

rspier
Copy link
Contributor

@rspier rspier commented Apr 15, 2019

Add a Makefile to make it easier to run all the tests and generate and view coverage data.

@rspier
Copy link
Contributor Author

rspier commented Apr 15, 2019

The test failure makes no sense, as no code was changed.

@abates
Copy link
Owner

abates commented Apr 15, 2019

The travis build fails when pulling in dependencies:

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/travis/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/travis/gopath"
GOPROXY=""
GORACE=""
GOROOT="/home/travis/.gimme/versions/go"
GOTMPDIR=""
GOTOOLDIR="/home/travis/.gimme/versions/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build372866423=/tmp/go-build -gno-record-gcc-switches"
before_install.1
2.73s$ go get golang.org/x/tools/cmd/cover
before_install.2
1.66s$ go get github.com/mattn/goveralls
install
0.00s$ travis_install_go_dependencies master -v
Makefile detected
0.05s$ go test -coverprofile=coverage.out -coverpkg=./,./plm,./link,./cmd/... ./...
cmd/ic/device.go:24:2: cannot find package "github.com/abates/cli" in any of:
	/home/travis/.gimme/versions/go/src/github.com/abates/cli (from $GOROOT)
	/home/travis/gopath/src/github.com/abates/cli (from $GOPATH)
cmd/ic/main.go:25:2: cannot find package "github.com/tarm/serial" in any of:
	/home/travis/.gimme/versions/go/src/github.com/tarm/serial (from $GOROOT)
	/home/travis/gopath/src/github.com/tarm/serial (from $GOPATH)
The command "go test -coverprofile=coverage.out -coverpkg=./,./plm,./link,./cmd/... ./..." exited with 1.
0.01s$ $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci
Error parsing coverage: open coverage.out: no such file or directory
The command "$HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci" exited with 1.

Since I haven't ever used Makefiles with travis, I don't know what needs to be done, maybe a go dep dependency in the Makefile?

@abates
Copy link
Owner

abates commented Apr 15, 2019

The relevant documentation for travis is here

Looks like if we add a go get dependency to the Makefile then that will fix the issue.

If you make the appropriate change then I'll merge the request.

Thanks!

@rspier
Copy link
Contributor Author

rspier commented Apr 16, 2019

Please look again.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 66.227% when pulling 0a22894 on rspier:makefile into 05bd2fd on abates:master.

@abates abates merged commit 3eb02a1 into abates:master Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants