From f414011617d65e2bc6c2da67244fb2ff03cba790 Mon Sep 17 00:00:00 2001 From: "Hana (Hyang-Ah) Kim" Date: Tue, 16 Jun 2020 13:44:36 -0400 Subject: [PATCH] test: increase timeout and skip gopls update check in testing installation tests require multiple fs operations, and 2s may be too short to complete everything on time. Allow more time. And disable the gopls update check in gopls testing. That shortens the time to bring up the gopls server. Also remove the hack to start the test with a clean user profile (--user-data-dir). That doesn't seem to work but interferes with picking up the workspace settings, which I do not understand why. Updates golang/vscode-go#169 Updates golang/vscode-go#43 Updates microsoft/vscode#97995 Change-Id: I5dbb33514a25a2071bf5bdf4ad248087e7e9b322 --- .vscode/launch.json | 1 - test/gopls/testfixtures/src/workspace/.vscode/settings.json | 3 ++- test/integration/install.test.ts | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 802966c193..94310ec823 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -64,7 +64,6 @@ "--disable-extensions", "--extensionDevelopmentPath=${workspaceFolder}", "--extensionTestsPath=${workspaceFolder}/out/test/gopls/index", - "--user-data-dir", "${workspaceFolder}/test/gopls/testfixtures/src/workspace", "--timeout", "999999", "${workspaceFolder}/test/gopls/testfixtures/src/workspace" // gopls requires a workspace to work with. ], diff --git a/test/gopls/testfixtures/src/workspace/.vscode/settings.json b/test/gopls/testfixtures/src/workspace/.vscode/settings.json index 7dca8d68f2..2474ded5bb 100644 --- a/test/gopls/testfixtures/src/workspace/.vscode/settings.json +++ b/test/gopls/testfixtures/src/workspace/.vscode/settings.json @@ -1,4 +1,5 @@ { "go.useLanguageServer": true, - "go.languageServerFlags": ["-rpc.trace", "serve"] + "go.languageServerFlags": ["-rpc.trace", "serve"], + "go.useGoProxyToCheckForToolUpdates": false, } \ No newline at end of file diff --git a/test/integration/install.test.ts b/test/integration/install.test.ts index 4c73e47383..f2de7f72f9 100644 --- a/test/integration/install.test.ts +++ b/test/integration/install.test.ts @@ -16,7 +16,9 @@ import { installTools } from '../../src/goInstallTools'; import { getTool, getToolAtVersion } from '../../src/goTools'; import { getBinPath, getGoVersion, rmdirRecursive } from '../../src/util'; -suite('Installation Tests', () => { +suite('Installation Tests', function () { + this.timeout(10000); + test('install tools', async () => { const goVersion = await getGoVersion(); const testCases: string[][] = [ @@ -33,6 +35,7 @@ suite('Installation Tests', () => { const sandbox = sinon.createSandbox(); const utils = require('../../src/util'); + const toolsGopathStub = sandbox.stub(utils, 'getToolsGopath').returns(tmpToolsGopath); const goConfig = Object.create(vscode.workspace.getConfiguration('go'), { toolsEnvVars: {