joefitzgerald / go-plus

An Enhanced Go Experience For The Atom Editor
https://atom.io/packages/go-plus
Other
1.51k stars 128 forks source link

coverage highlighting only appears in one file #742

Closed dtenenba closed 6 years ago

dtenenba commented 6 years ago

Prerequisites

Description

I have a project with several source files in the same package, along with test files. So for example, I have the following source and test files, all in the main package:

As you might imagine, main_test.go tests functions in main.go and download_test.go tests functions in download.go.

When I make a change and save, the coverage highlighting is updated in main.go but not in download.go. There is no highlighting in download.go or any file except main.go.

The problem seems to be with go-plus as when I run the following commands I see that some of download.go IS covered by tests.

go test -coverprofile=coverage.out
go tool cover -html=coverage.out

Output from atom -v && apm -v

Atom    : 1.23.3
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0
apm  1.18.12
npm  3.10.10
node 6.9.5 x64
atom 1.23.3
python 2.7.10
git 2.14.3

Output From go env

GOARCH="amd64"
GOBIN="/Users/dtenenba/gopath/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/dtenenba/gopath"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hv/wd4_6wkd47d6zl_34v2hy0qh0000gq/T/go-build130302451=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

Steps to Reproduce

go get github.com/FredHutch/sftp_downloader
cd $GOPATH/src/github.com/FredHutch/sftp_downloader
git checkout golang-implementation
git checkout a4661e2973874ce0c5f80a102b584662f79be2d4 .
go get ./...
go get github.com/golang/mock/gomock
go get github.com/golang/mock/mockgen
go generate ./...
go test -coverprofile=coverage.out
go tool cover -html=coverage.out # confirm that download.go has partial coverage
atom -n .

Now make a change in download.go (add a space and remove it) and save it.

Expected Behavior

Expect to see some lines in download.go highlighted with red to show they are not covered. For example, line 18 should be highlighted as it is in the HTML report.

Actual Behavior

No lines in download.go are highlighted.

main.go is highlighted correctly.

zmb3 commented 6 years ago

Thank you so much for the detailed reproduction steps! We’ll take a look as soon as we can.

dtenenba commented 6 years ago

One more data point: my home machine, which has basically the same configuration, does not have this issue. If you like I can provide the atom -v && apm -v and go env information for that machine later today.

joefitzgerald commented 6 years ago

@dtenenba it looks like github.com/FredHutch/sftpdownloader is no longer accessible. Could you provide the output from your atom -v && apm -v and go env from each machine?

dtenenba commented 6 years ago

Sorry, it's actually sftp_downloader, with an underscore.

However, it seems like this issue spontaneously resolved itself, not sure if it was rebooting the machine or restarting Atom. If I see it again I will let you know, but until then I'll close this. Thanks for looking into it....