Skip to content

Commit

Permalink
test: fix resolve file names in logs tests for GOPATH
Browse files Browse the repository at this point in the history
The tests that were supposed to be for GOPATH mode were also
testing modules mode. This changes fixes that, as well as increases
the timeout for these tests, as they sometimes fail in the long tests
for windows.

Change-Id: Id6715013470b968f4a4aa3fbbbf48ded3751389d
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/276852
Trust: Suzy Mueller <[email protected]>
Trust: Hyang-Ah Hana Kim <[email protected]>
Run-TryBot: Suzy Mueller <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
  • Loading branch information
suzmue committed Dec 10, 2020
1 parent 27a25c4 commit 6407dc1
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test/integration/test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ suite('Test Go Test Args', () => {
});

suite('Test Go Test', function () {
this.timeout(10000);
this.timeout(50000);

const sourcePath = path.join(__dirname, '..', '..', '..', 'test', 'testdata', 'goTestTest');

Expand Down Expand Up @@ -134,8 +134,6 @@ suite('Test Go Test', function () {
input: { isMod: boolean, includeSubDirectories: boolean, testFlags?: string[], applyCodeCoverage?: boolean },
wantFiles: string[]) {

fs.copySync(sourcePath, repoPath, { recursive: true });

const config = Object.create(vscode.workspace.getConfiguration('go'));
const outputChannel = new FakeOutputChannel();

Expand Down Expand Up @@ -184,21 +182,21 @@ suite('Test Go Test', function () {
});

test('resolves file names in logs (GOPATH)', async () => {
setupRepo(true);
setupRepo(false);
await runTest(
{ isMod: true, includeSubDirectories: true },
{ isMod: false, includeSubDirectories: true },
[path.join(repoPath, 'a_test.go'), path.join(repoPath, 'b', 'b_test.go')]);
await runTest(
{ isMod: true, includeSubDirectories: false },
{ isMod: false, includeSubDirectories: false },
[path.join(repoPath, 'a_test.go')]);
await runTest(
{ isMod: true, includeSubDirectories: true, testFlags: ['-v'] },
{ isMod: false, includeSubDirectories: true, testFlags: ['-v'] },
[path.join(repoPath, 'a_test.go'), path.join(repoPath, 'b', 'b_test.go')]);
await runTest(
{ isMod: true, includeSubDirectories: true, testFlags: ['-race'], applyCodeCoverage: true },
{ isMod: false, includeSubDirectories: true, testFlags: ['-race'], applyCodeCoverage: true },
[path.join(repoPath, 'a_test.go'), path.join(repoPath, 'b', 'b_test.go')]);
await runTest(
{ isMod: true, includeSubDirectories: false, testFlags: ['-v'] },
{ isMod: false, includeSubDirectories: false, testFlags: ['-v'] },
[path.join(repoPath, 'a_test.go')]);
});
});
Expand Down

0 comments on commit 6407dc1

Please sign in to comment.