Skip to content

Commit 9bb57d8

Browse files
committed
test/integration: skip tests broken on windows
Added affectedByIssue832 to clearly indicate the tests that need to be fixed. For #832 For #1788 Change-Id: Ied7dc9726b33f092ae93a1f11952f97fd1433337 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/418356 Reviewed-by: Jamal Carvalho <[email protected]> TryBot-Result: kokoro <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
1 parent b012df4 commit 9bb57d8

File tree

7 files changed

+54
-8
lines changed

7 files changed

+54
-8
lines changed

test/integration/extension.test.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import {
4646
import cp = require('child_process');
4747
import os = require('os');
4848
import { MockExtensionContext } from '../mocks/MockContext';
49+
import { affectedByIssue832 } from './testutils';
4950

5051
const testAll = (isModuleMode: boolean) => {
5152
const dummyCancellationSource = new vscode.CancellationTokenSource();
@@ -741,7 +742,10 @@ It returns the number of bytes written and any write error encountered.
741742
assert.equal(interfaces[0].name, 'circle');
742743
});
743744

744-
test('Test listPackages', async () => {
745+
test('Test listPackages', async function () {
746+
if (affectedByIssue832()) {
747+
this.skip(); // timeout on windows
748+
}
745749
const uri = vscode.Uri.file(path.join(fixturePath, 'baseTest', 'test.go'));
746750
const document = await vscode.workspace.openTextDocument(uri);
747751
await vscode.window.showTextDocument(document);
@@ -793,7 +797,10 @@ It returns the number of bytes written and any write error encountered.
793797
});
794798
});
795799

796-
test('Workspace Symbols', () => {
800+
test('Workspace Symbols', function () {
801+
if (affectedByIssue832()) {
802+
this.skip(); // frequent timeout on windows
803+
}
797804
const workspacePath = path.join(fixturePath, 'vendoring');
798805
const configWithoutIgnoringFolders = Object.create(getGoConfig(), {
799806
gotoSymbol: {
@@ -861,7 +868,11 @@ It returns the number of bytes written and any write error encountered.
861868
return Promise.all([withIgnoringFolders, withoutIgnoringFolders, withIncludingGoroot, withoutIncludingGoroot]);
862869
});
863870

864-
test('Test Completion', async () => {
871+
test('Test Completion', async function () {
872+
if (affectedByIssue832()) {
873+
this.skip(); // timeout on windows
874+
}
875+
865876
const printlnDoc = `Println formats using the default formats for its operands and writes to
866877
standard output. Spaces are always added between operands and a newline is
867878
appended. It returns the number of bytes written and any write error
@@ -911,7 +922,10 @@ encountered.
911922
await Promise.all(promises);
912923
});
913924

914-
test('Test Completion Snippets For Functions', async () => {
925+
test('Test Completion Snippets For Functions', async function () {
926+
if (affectedByIssue832()) {
927+
this.skip(); // timeout on windows
928+
}
915929
const provider = new GoCompletionItemProvider();
916930
const uri = vscode.Uri.file(path.join(fixturePath, 'completions', 'snippets.go'));
917931
const baseConfig = getGoConfig();
@@ -1176,7 +1190,7 @@ encountered.
11761190
});
11771191

11781192
test('Test Completion on unimported packages', async function () {
1179-
if (isModuleMode) {
1193+
if (isModuleMode || affectedByIssue832()) {
11801194
this.skip();
11811195
}
11821196
// gocode-gomod does not handle unimported package completion.
@@ -1212,7 +1226,10 @@ encountered.
12121226
await Promise.all(promises);
12131227
});
12141228

1215-
test('Test Completion on unimported packages (multiple)', async () => {
1229+
test('Test Completion on unimported packages (multiple)', async function () {
1230+
if (affectedByIssue832()) {
1231+
this.skip();
1232+
}
12161233
const config = Object.create(getGoConfig(), {
12171234
gocodeFlags: { value: ['-builtin'] }
12181235
});

test/integration/goDebug.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { killProcessTree, killProcess } from '../../src/utils/processUtils';
3232
import getPort = require('get-port');
3333
import util = require('util');
3434
import { TimestampedLogger } from '../../src/goLogging';
35+
import { affectedByIssue832 } from './testutils';
3536

3637
// For debugging test and streaming the trace instead of buffering, set this.
3738
const PRINT_TO_CONSOLE = false;
@@ -1728,7 +1729,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
17281729
// has a chance to clean up.
17291730
// BUG(https://github.com/golang/vscode-go/issues/1993)
17301731
test('should cleanup when stopped', async function () {
1731-
if (!isDlvDap) {
1732+
if (!isDlvDap || affectedByIssue832()) {
17321733
this.skip();
17331734
}
17341735
const PROGRAM = path.join(DATA_ROOT, 'loop');
@@ -1990,6 +1991,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
19901991
});
19911992

19921993
suite('substitute path', () => {
1994+
if (affectedByIssue832()) {
1995+
return;
1996+
}
19931997
// TODO(suzmue): add unit tests for substitutePath.
19941998
let tmpDir: string;
19951999

test/integration/goDebugConfiguration.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { rmdirRecursive } from '../../src/util';
1414
import goEnv = require('../../src/goEnv');
1515
import { MockCfg } from '../mocks/MockCfg';
1616
import { extensionId } from '../../src/const';
17+
import { affectedByIssue832 } from './testutils';
1718

1819
suite('Debug Environment Variable Merge Test', () => {
1920
const debugConfigProvider = new GoDebugConfigurationProvider();
@@ -630,6 +631,9 @@ suite('Debug Configuration With Invalid Program', () => {
630631
});
631632

632633
suite('Debug Configuration Converts Relative Paths', () => {
634+
if (affectedByIssue832()) {
635+
return;
636+
}
633637
const debugConfigProvider = new GoDebugConfigurationProvider();
634638

635639
let workspaceDir = '';

test/integration/goExplorer.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { getConfiguredTools } from '../../src/goTools';
1313
import { getGoVersion } from '../../src/util';
1414
import { resolveHomeDir } from '../../src/utils/pathUtils';
1515
import { MockExtensionContext } from '../mocks/MockContext';
16+
import { affectedByIssue832 } from './testutils';
1617

1718
suite('GoExplorerProvider', () => {
1819
const fixtureDir = path.join(__dirname, '../../../test/testdata/baseTest');
@@ -36,7 +37,10 @@ suite('GoExplorerProvider', () => {
3637
assert.strictEqual(env.contextValue, 'go:explorer:envtree');
3738
});
3839

39-
test('env tree items', async () => {
40+
test('env tree items', async function () {
41+
if (affectedByIssue832()) {
42+
this.skip();
43+
}
4044
const [env] = await explorer.getChildren()!;
4145
const [goenv, gomod] = (await explorer.getChildren(env)) as { key: string; value: string }[];
4246
assert.strictEqual(goenv.key, 'GOENV');

test/integration/goTest.explore.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import * as config from '../../src/config';
1515
import { GoTestResolver } from '../../src/goTest/resolve';
1616
import * as testUtils from '../../src/testUtils';
1717
import { GoTest } from '../../src/goTest/utils';
18+
import { affectedByIssue832 } from './testutils';
1819

1920
type Files = Record<string, string | { contents: string; language: string }>;
2021

@@ -56,6 +57,9 @@ async function forceResolve(resolver: GoTestResolver, item?: TestItem) {
5657

5758
suite('Go Test Explorer', () => {
5859
suite('Document opened', () => {
60+
if (affectedByIssue832()) {
61+
return;
62+
}
5963
class DUT extends GoTestExplorer {
6064
async _didOpen(doc: TextDocument) {
6165
await this.didOpenTextDocument(doc);
@@ -113,6 +117,9 @@ suite('Go Test Explorer', () => {
113117
});
114118

115119
suite('Document edited', async () => {
120+
if (affectedByIssue832()) {
121+
return;
122+
}
116123
class DUT extends GoTestExplorer {
117124
async _didOpen(doc: TextDocument) {
118125
await this.didOpenTextDocument(doc);
@@ -224,6 +231,9 @@ suite('Go Test Explorer', () => {
224231
});
225232

226233
suite('settings', () => {
234+
if (affectedByIssue832()) {
235+
return;
236+
}
227237
const sandbox = sinon.createSandbox();
228238

229239
// eslint-disable-next-line @typescript-eslint/no-explicit-any

test/integration/goTest.resolve.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { GoTestResolver } from '../../src/goTest/resolve';
88
import { GoTest, GoTestKind } from '../../src/goTest/utils';
99
import { MockTestController, MockTestWorkspace } from '../mocks/MockTest';
1010
import { getSymbols_Regex, populateModulePathCache } from './goTest.utils';
11+
import { affectedByIssue832 } from './testutils';
1112

1213
type Files = Record<string, string | { contents: string; language: string }>;
1314

@@ -25,6 +26,9 @@ function setup(folders: string[], files: Files) {
2526
}
2627

2728
suite('Go Test Resolver', () => {
29+
if (affectedByIssue832()) {
30+
return;
31+
}
2832
interface TC extends TestCase {
2933
item?: ([string, string, GoTestKind] | [string, string, GoTestKind, string])[];
3034
expect: string[];

test/integration/testutils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function affectedByIssue832(): boolean {
2+
return process.platform === 'win32';
3+
}

0 commit comments

Comments
 (0)