Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

test/gopls: initial test setup for gopls and hover tests #3157

Merged
merged 1 commit into from
Apr 27, 2020

Commits on Apr 6, 2020

  1. test/gopls: initial test setup for gopls and hover tests

    This CL includes only HoverProvider tests, that use the same scenario
    as the hover provider tests with godoc and gogetdoc in
    integration/extension.test.ts.
    
    Gopls test setup is complicated because gopls currently does not
    work in a single-file mode nor support mono repos with multiple
    modules. VS Code in test environment does not support dynamic
    registration of workspace folders during testing.  So, the
    workspace folder needs to be specified before the extension
    host launches (by vscode-test.runTests or launch.json extensionHost
    type tasks).
    
    As a workaround, I use an empty directory and start the extension
    host with the empty directory for a testing. Then, let the test
    populate the directory with necessary files. This is not ideal;
    file copy is slow and the use of the single workspace directory
    prevents parallelized testing.
    
    Commiting an empty directory to use as a scratch space is not
    ideal either, but no worse than what vscode dev in my opinion.
    https://github.com/microsoft/vscode/blob/master/.vscode/launch.json
    
    I also considered shelling out the extension host launch
    after creating a temp directory and using it as a workspace directory.
    That may work inside test/runTest.ts, but complicates debugging
    when sarting the test using launch.json.
    
    Also passes '--user-data-dir' flag to prevent the tests from
    using my personal vscode settings and interfere tests.
    
    Change-Id: I7b064441720da5c89833afab35e8273de808cfad
    hyangah committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    d5e417d View commit details
    Browse the repository at this point in the history