Skip to content

Commit

Permalink
[release] src/testUtils.ts: always run test in package list mode
Browse files Browse the repository at this point in the history
During v0.16 dev cycle, we switched tests to run in local directory
mode by not specifying the target package path to be tested.

This has two unintended side-effects:

1) prints all stderr/stdout from the tested target when tests succeed.
2) disables test caching.

Whether `Go: Test Package` should run the tests in local directory
mode or in package list mode is debatable.
https://golang.org/cmd/go/#hdr-Test_packages
But, we've been using the package list mode for a long time without
complaint. So, this is a regression that needs to be fixed.

Fixes #528

Change-Id: Ied06130db1ab6e53b2fb3a3b19ab13b0985fc779
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/248738
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Rebecca Stambler <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
(cherry picked from commit a357893e7b5c24c1443deaca629584e47b4e22c2)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/252119
  • Loading branch information
hyangah committed Sep 1, 2020
1 parent 903ccc7 commit 354ea27
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export async function goTest(testconfig: TestConfig): Promise<boolean> {
let pkgMapPromise: Promise<Map<string, string> | null> = Promise.resolve(null);

if (testconfig.isMod) {
getCurrentPackagePromise = getCurrentPackage(testconfig.dir);
// We need the mapping to get absolute paths for the files in the test output.
pkgMapPromise = getNonVendorPackages(testconfig.dir, !!testconfig.includeSubDirectories);
} else { // GOPATH mode
Expand Down

0 comments on commit 354ea27

Please sign in to comment.