Skip to content

Commit 9fcd568

Browse files
committed
test: remove symlink tests for substitutePath
Although these tests do work right now, they depend on the implementation of the go command in a way I do not fully understand. The rest of the tests are sufficient to test the substitutePath implementation as opposed to how symlinks are interpreted by go or dlv. substitutePath may not be necessary for all symlinked projects. For example, when running on darwin: $ ls ~/go/src/github.com/user/package main.go $ ln -s ~/go/src/github.com/user ~/githubuser/ $ cd ~/githubuser/package; dlv debug (dlv) sources ~/go/src/github.com/user/package/main.go If a go.mod file is added into the package in the GOPATH: $ ls ~/go/src/github.com/user/package main.go go.mod $ ln -s ~/go/src/github.com/user ~/githubuser/ $ cd ~/githubuser/package; dlv debug (dlv) sources ~/githubuser/package/main.go Updates #622 Change-Id: Ie9893ac3cdcac3a8efcda95056dca6df271a85bd Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/277961 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]>
1 parent 0dee1a8 commit 9fcd568

File tree

1 file changed

+0
-62
lines changed

1 file changed

+0
-62
lines changed

test/integration/goDebug.test.ts

-62
Original file line numberDiff line numberDiff line change
@@ -1297,68 +1297,6 @@ suite('Go Debug Adapter', function () {
12971297
rmdirRecursive(tmpDir);
12981298
});
12991299

1300-
suite('substitutePath with symlinks', () => {
1301-
let linkedDir: string;
1302-
setup(() => {
1303-
linkedDir = path.join(tmpDir, 'src');
1304-
fs.symlinkSync(DATA_ROOT, linkedDir);
1305-
});
1306-
1307-
teardown(() => {
1308-
fs.unlinkSync(linkedDir);
1309-
});
1310-
1311-
test('should stop on a breakpoint set in file with substituted path', () => {
1312-
const PROGRAM_TEMP = path.join(linkedDir, 'baseTest');
1313-
const PROGRAM = path.join(DATA_ROOT, 'baseTest');
1314-
1315-
const FILE = path.join(PROGRAM_TEMP, 'test.go');
1316-
const BREAKPOINT_LINE = 11;
1317-
1318-
const config = {
1319-
name: 'Launch',
1320-
type: 'go',
1321-
request: 'launch',
1322-
mode: 'auto',
1323-
program: PROGRAM_TEMP,
1324-
substitutePath: [
1325-
{
1326-
from: PROGRAM_TEMP,
1327-
to: PROGRAM
1328-
}
1329-
]
1330-
};
1331-
const debugConfig = debugConfigProvider.resolveDebugConfiguration(undefined, config);
1332-
1333-
return dc.hitBreakpoint(debugConfig, getBreakpointLocation(FILE, BREAKPOINT_LINE));
1334-
});
1335-
1336-
test('should stop on a breakpoint in test file with substituted path', () => {
1337-
const PROGRAM_TEMP = path.join(linkedDir, 'baseTest');
1338-
const PROGRAM = path.join(DATA_ROOT, 'baseTest');
1339-
1340-
const FILE = path.join(PROGRAM_TEMP, 'sample_test.go');
1341-
const BREAKPOINT_LINE = 15;
1342-
1343-
const config = {
1344-
name: 'Launch file',
1345-
type: 'go',
1346-
request: 'launch',
1347-
mode: 'test',
1348-
program: PROGRAM_TEMP,
1349-
substitutePath: [
1350-
{
1351-
from: PROGRAM_TEMP,
1352-
to: PROGRAM
1353-
}
1354-
]
1355-
};
1356-
const debugConfig = debugConfigProvider.resolveDebugConfiguration(undefined, config);
1357-
1358-
return dc.hitBreakpoint(debugConfig, getBreakpointLocation(FILE, BREAKPOINT_LINE));
1359-
});
1360-
});
1361-
13621300
function copyDirectory(name: string) {
13631301
const from = path.join(DATA_ROOT, name);
13641302
const to = path.join(tmpDir, name);

0 commit comments

Comments
 (0)