cmd/testwrapper: detect cached tests with coverage output (#18559)
Using -coverprofile was breaking the (cached) detection logic because that adds extra information to the end of the line. Updates tailscale/go#150 Change-Id: Ie1bf4e1e04e21db00a6829695098fb61d80a2641 Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
@@ -130,7 +130,10 @@ func runTests(ctx context.Context, attempt int, pt *packageTests, goTestArgs, te
|
||||
resultMap[pkg] = pkgTests
|
||||
}
|
||||
if goOutput.Test == "" {
|
||||
if strings.HasSuffix(goOutput.Output, "\t(cached)\n") && goOutput.Package != "" {
|
||||
// Detect output lines like:
|
||||
// ok \ttailscale.com/cmd/testwrapper\t(cached)
|
||||
// ok \ttailscale.com/cmd/testwrapper\t(cached)\tcoverage: 17.0% of statements
|
||||
if goOutput.Package != "" && strings.Contains(goOutput.Output, fmt.Sprintf("%s\t(cached)", goOutput.Package)) {
|
||||
pkgCached[goOutput.Package] = true
|
||||
}
|
||||
switch goOutput.Action {
|
||||
|
||||
Reference in New Issue
Block a user