mirror of
https://github.com/golang/go
synced 2024-11-24 20:10:02 -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))
|
f, _, err := cache.GetFile(cache.Default(), coverProfileAndInputKey(testID, testInputsID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if cache.DebugTest {
|
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
|
return false
|
||||||
}
|
}
|
||||||
@ -2062,8 +2062,8 @@ func (c *runCache) saveOutput(a *work.Action, coverProfileFile string) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
} else if cache.DebugTest {
|
} else if cache.DebugTest {
|
||||||
base.Errorf("failed to open temporary coverprofile: %s", err)
|
// Not indicative of a problem, as the test may not have generated a cover profile yet.
|
||||||
return
|
fmt.Fprintf(os.Stderr, "testcache: %s: opening temporary coverprofile: %s\n", a.Package.ImportPath, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if c.id1 != (cache.ActionID{}) {
|
if c.id1 != (cache.ActionID{}) {
|
||||||
|
@ -128,7 +128,7 @@ go test testcache -run=TestOSArgs -fullpath
|
|||||||
go test testcache -run=TestOSArgs -fullpath
|
go test testcache -run=TestOSArgs -fullpath
|
||||||
stdout '\(cached\)'
|
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
|
||||||
go test testcache -run=TestCoverageCache -coverprofile=coverage.out
|
go test testcache -run=TestCoverageCache -coverprofile=coverage.out
|
||||||
stdout '\(cached\)'
|
stdout '\(cached\)'
|
||||||
|
Loading…
Reference in New Issue
Block a user