mirror of
https://github.com/golang/go
synced 2024-11-21 11:34:44 -07:00
dont return error when no coverage info exists yet
This commit is contained in:
parent
171ab52698
commit
a75bc4d35c
@ -1869,7 +1869,7 @@ func (c *runCache) tryCacheWithID(b *work.Builder, a *work.Action, id string) bo
|
||||
f, _, err := cache.GetFile(cache.Default(), coverProfileAndInputKey(testID, testInputsID))
|
||||
if err != nil {
|
||||
if cache.DebugTest {
|
||||
fmt.Fprintf(os.Stderr, "testcache: %s: test coverage profile not found: %v\n", a.Package.ImportPath, err)
|
||||
fmt.Fprintf(os.Stderr, "testcache: %s: cached test result valid but cached coverage profile missing: %v\n", a.Package.ImportPath, err)
|
||||
}
|
||||
return false
|
||||
}
|
||||
@ -2062,8 +2062,8 @@ func (c *runCache) saveOutput(a *work.Action, coverProfileFile string) {
|
||||
}
|
||||
}()
|
||||
} else if cache.DebugTest {
|
||||
base.Errorf("failed to open temporary coverprofile: %s", err)
|
||||
return
|
||||
// Not indicative of a problem, as the test may not have generated a cover profile yet.
|
||||
fmt.Fprintf(os.Stderr, "testcache: %s: opening temporary coverprofile: %s\n", a.Package.ImportPath, err)
|
||||
}
|
||||
}
|
||||
if c.id1 != (cache.ActionID{}) {
|
||||
|
@ -128,7 +128,7 @@ go test testcache -run=TestOSArgs -fullpath
|
||||
go test testcache -run=TestOSArgs -fullpath
|
||||
stdout '\(cached\)'
|
||||
|
||||
# Ensure that specifying a cover profile does not prevent test results from being cached.
|
||||
# Ensure that coverage profiles are being cached.
|
||||
go test testcache -run=TestCoverageCache -coverprofile=coverage.out
|
||||
go test testcache -run=TestCoverageCache -coverprofile=coverage.out
|
||||
stdout '\(cached\)'
|
||||
|
Loading…
Reference in New Issue
Block a user