diff options
author | Michael Matloob <matloob@golang.org> | 2020-06-22 18:39:10 -0400 |
---|---|---|
committer | Michael Matloob <matloob@golang.org> | 2020-08-17 18:31:55 +0000 |
commit | 38fea3a4ec97fbcfad1f2d329f3a12c53cc36301 (patch) | |
tree | 89aef6c9f5685224b5517a933419f155521922d4 /src/cmd/go/internal/test/test.go | |
parent | 15b98e55d195bd876203506d5f513546dd4e3b36 (diff) | |
download | go-38fea3a4ec97fbcfad1f2d329f3a12c53cc36301.tar.gz go-38fea3a4ec97fbcfad1f2d329f3a12c53cc36301.zip |
cmd/go: add tracing instrumentation to load.TestPackagesFor
This change adds tracing instrumentation into load.TestPackagesFor,
propagating context through its callers.
Updates #38714
Change-Id: I80fefaf3116ccccffaa8bb7613a656bda867394c
Reviewed-on: https://go-review.googlesource.com/c/go/+/248323
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/test/test.go')
-rw-r--r-- | src/cmd/go/internal/test/test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go index 9788590938..cda51053fb 100644 --- a/src/cmd/go/internal/test/test.go +++ b/src/cmd/go/internal/test/test.go @@ -746,7 +746,7 @@ func runTest(ctx context.Context, cmd *base.Command, args []string) { ensureImport(p, "sync/atomic") } - buildTest, runTest, printTest, err := builderTest(&b, p) + buildTest, runTest, printTest, err := builderTest(&b, ctx, p) if err != nil { str := err.Error() str = strings.TrimPrefix(str, "\n") @@ -813,7 +813,7 @@ var windowsBadWords = []string{ "update", } -func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, printAction *work.Action, err error) { +func builderTest(b *work.Builder, ctx context.Context, p *load.Package) (buildAction, runAction, printAction *work.Action, err error) { if len(p.TestGoFiles)+len(p.XTestGoFiles) == 0 { build := b.CompileAction(work.ModeBuild, work.ModeBuild, p) run := &work.Action{Mode: "test run", Package: p, Deps: []*work.Action{build}} @@ -836,7 +836,7 @@ func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, prin DeclVars: declareCoverVars, } } - pmain, ptest, pxtest, err := load.TestPackagesFor(p, cover) + pmain, ptest, pxtest, err := load.TestPackagesFor(ctx, p, cover) if err != nil { return nil, nil, nil, err } |