vladopajic / go-test-coverage

go-test-coverage is tool and github action which reports issues when test coverage is below set threshold
GNU General Public License v3.0
78 stars 9 forks source link

"Could not find file, exit status 1" (v2.8.2) #55

Closed joeig closed 4 months ago

joeig commented 8 months ago

Hi, and thanks for building go-test-coverage.

Starting with v2.8.2, I get the following error message (example):

failed to generate coverage statistics: could not find file [github.com/joeig/go-powerdns/v3/config.go]: can't find "config.go": go/build: go list github.com/joeig/go-powerdns/v3/: exit status 1
go: github.com/jarcoal/httpmock@v1.3.1: GOPROXY list is not the empty string, but contains no entries

The quick fix was to pin v2.8.1. I haven't had a chance to look into why this started happening with v2.8.2, but I wanted to record my finding in case someone else stumbles across this.

Johannes

vladopajic commented 8 months ago

thanks for reporting this issue. i'll have a look into this

vladopajic commented 8 months ago

adding local-prefix to testcoverage.yml seems to fix this issue.

example:

---
profile: ./coverage.out
local-prefix: "github.com/joeig/go-powerdns/v3"
threshold:
  # Note: Update README.md in case thresholds change.
  file: 100
  package: 100
  total: 100
joeig commented 8 months ago

Thanks, @vladopajic! I'll try it out.

With which version did this become necessary?

vladopajic commented 8 months ago

it actually hasn't become necessary. i just figured out that, in this case, the most recent version works if that property is set. still haven't done proper investigation to understand what's happening.

joeig commented 8 months ago

Thank you for your help!

joeig commented 4 months ago

I cannot reproduce this issue with v2.10.1. Thanks for your help.