Skip to content

Commit ffae001

Browse files
committed
test/integration/goDebug: skip redundant tests in withConsole mode
integrated terminal mode testing doesn't need to run the full test suite. It is sufficient to check message forwarding through the proxy thin adapter is working. So, skip most of irrelevant tests that are tested in the default mode. And avoid printing the 'env' property that floods the test output and may leak too much information in logging. Change-Id: I83ce54413cc9ca291e4b5237fca47bc3a2ac92b0 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/418542 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Suzy Mueller <[email protected]>
1 parent c909738 commit ffae001

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

test/integration/goDebug.test.ts

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
439439
// an initialized event.
440440
await Promise.all([
441441
new Promise<void>(async (resolve) => {
442-
console.log(`Setting up attach request for ${JSON.stringify(debugConfig)}.`);
442+
const debugConfigCopy = Object.assign({}, debugConfig);
443+
delete debugConfigCopy.env;
444+
console.log(`Setting up attach request for ${JSON.stringify(debugConfigCopy)}.`);
443445
const attachResult = await dc.attachRequest(debugConfig as DebugProtocol.AttachRequestArguments);
444446
assert.ok(attachResult.success);
445447
resolve();
@@ -556,6 +558,10 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
556558
});
557559

558560
suite('env', () => {
561+
if (!isDlvDap) {
562+
return;
563+
}
564+
559565
let sandbox: sinon.SinonSandbox;
560566

561567
setup(() => {
@@ -620,6 +626,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
620626
});
621627

622628
suite('launch', () => {
629+
if (!isDlvDap) {
630+
return;
631+
}
623632
test('should run program to the end', async () => {
624633
const PROGRAM = path.join(DATA_ROOT, 'baseTest');
625634

@@ -828,6 +837,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
828837
});
829838

830839
suite('set current working directory', () => {
840+
if (!isDlvDap) {
841+
return;
842+
}
831843
test('should debug program with cwd set', async () => {
832844
const WD = path.join(DATA_ROOT, 'cwdTest');
833845
const PROGRAM = path.join(WD, 'cwdTest');
@@ -994,6 +1006,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
9941006
});
9951007

9961008
suite('remote attach', () => {
1009+
if (withConsole) {
1010+
return;
1011+
}
9971012
let childProcess: cp.ChildProcess;
9981013
let server: number;
9991014
let debugConfig: DebugConfiguration;
@@ -1094,6 +1109,11 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
10941109
await dc.hitBreakpoint(debugConfig, getBreakpointLocation(FILE, BREAKPOINT_LINE));
10951110
});
10961111

1112+
// stop here for integrated terminal test mode.
1113+
if (withConsole) {
1114+
return;
1115+
}
1116+
10971117
test('stopped for a breakpoint set during initialization (remote attach)', async () => {
10981118
const FILE = path.join(DATA_ROOT, 'helloWorldServer', 'main.go');
10991119
const BREAKPOINT_LINE = 29;
@@ -1298,6 +1318,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
12981318
});
12991319

13001320
suite('conditionalBreakpoints', () => {
1321+
if (withConsole) {
1322+
return;
1323+
}
13011324
test('should stop on conditional breakpoint', async () => {
13021325
const PROGRAM = path.join(DATA_ROOT, 'condbp');
13031326
const FILE = path.join(DATA_ROOT, 'condbp', 'condbp.go');
@@ -1432,6 +1455,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
14321455
});
14331456

14341457
suite('panicBreakpoints', () => {
1458+
if (withConsole) {
1459+
return;
1460+
}
14351461
test('should stop on panic', async () => {
14361462
const PROGRAM_WITH_EXCEPTION = path.join(DATA_ROOT, 'panic');
14371463

@@ -1519,6 +1545,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
15191545
});
15201546

15211547
suite('disconnect', () => {
1548+
if (withConsole) {
1549+
return;
1550+
}
15221551
// The teardown code for the Go Debug Adapter test suite issues a disconnectRequest.
15231552
// In order for these tests to pass, the debug adapter must not fail if a
15241553
// disconnectRequest is sent after it has already disconnected.
@@ -1775,6 +1804,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
17751804
});
17761805

17771806
suite('switch goroutine', () => {
1807+
if (withConsole) {
1808+
return;
1809+
}
17781810
async function continueAndFindParkedGoroutine(file: string): Promise<number> {
17791811
// Find a goroutine that is stopped in parked.
17801812
const bp = getBreakpointLocation(file, 8);
@@ -1915,6 +1947,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
19151947
});
19161948

19171949
suite('logDest attribute tests', () => {
1950+
if (!isDlvDap) {
1951+
return;
1952+
}
19181953
const PROGRAM = path.join(DATA_ROOT, 'baseTest');
19191954

19201955
let tmpDir: string;
@@ -1986,7 +2021,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) =>
19862021
});
19872022

19882023
suite('substitute path', () => {
1989-
if (affectedByIssue832()) {
2024+
if (withConsole || affectedByIssue832()) {
19902025
return;
19912026
}
19922027
// TODO(suzmue): add unit tests for substitutePath.

0 commit comments

Comments
 (0)