diff options
| author | Russ Egan <russell.egan@thalesgroup.com> | 2026-03-05 00:46:20 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-06 10:42:12 -0800 |
| commit | 6c083034f82ddb2a91d3fbe0f96e39f1ecd194d8 (patch) | |
| tree | 5adefb16c5e80b9bf0a94261f5dfcb713bd16253 /api | |
| parent | 73db2f85aab25c06f47c832364600d2c5e243ffa (diff) | |
| download | go-6c083034f82ddb2a91d3fbe0f96e39f1ecd194d8.tar.xz | |
testing: fix construction of the testing artifacts path
The existing implementation had a few problems:
- It constructs a path which starts with a forward slash, which is
then immediately rejected by filepath.Localize() as invalid.
- It did not correctly remove the module path from the import path if
the test was in the root package of the module: it would do the
equivalent of strings.TrimPrefix("example.com/jdoe/loader",
"example.com/jdoe/loader/"), which trims nothing, and leaves the full
module name in the base.
- Tests didn't check for any behaviors related to which artifact path
was selected.
Removed leading slash, handle tests in the root package by omitting the
<pkg> component from the artifact dir path, and add tests.
Fixes #77763
Change-Id: I00fc7381b939e4d8a8a9811e2a95fc2d8c5a6e84
GitHub-Last-Rev: 9c39392a691a81cef48adde88ab45dc40ed81105
GitHub-Pull-Request: golang/go#77778
Reviewed-on: https://go-review.googlesource.com/c/go/+/748581
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'api')
0 files changed, 0 insertions, 0 deletions
