Skip to content

Commit

Permalink
test: increase timeout and skip gopls update check in testing
Browse files Browse the repository at this point in the history
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 #169
Updates #43
Updates microsoft/vscode#97995

Change-Id: I0e8b7d8f1f47f2e68696c6bd078c1ad2a0fe6780
GitHub-Last-Rev: f414011
GitHub-Pull-Request: #231
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/238001
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
  • Loading branch information
hyangah committed Jun 16, 2020
1 parent ede2b2e commit 51b6e00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.
],
Expand Down
3 changes: 2 additions & 1 deletion test/gopls/testfixtures/src/workspace/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"go.useLanguageServer": true,
"go.languageServerFlags": ["-rpc.trace", "serve"]
"go.languageServerFlags": ["-rpc.trace", "serve"],
"go.useGoProxyToCheckForToolUpdates": false,
}
5 changes: 4 additions & 1 deletion test/integration/install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[][] = [
Expand All @@ -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: {
Expand Down

0 comments on commit 51b6e00

Please sign in to comment.