Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go Test Explorer shows wrong state 'running' after it errors refusing to run multiple tests with debugger #2025

Open
jimsnab opened this issue Jan 23, 2022 · 3 comments
Assignees
Labels
Go Companion Issues relating to the Go Companion extension go-test issues related to go test support (test output, test explorer, ...) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@jimsnab
Copy link

jimsnab commented Jan 23, 2022

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.17.1 linux/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • golang.org/x/tools/gopls v0.7.5
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.63.2
      899d46d82c4c95423fb7e10e68eba52050e30ba3
      x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • go v0.30.0
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
    • too long and seemingly irrelevant

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

Describe the bug

The Go test runner doesn't support debug of multiple tests, according to a red message that appears when trying it. However, after the red message appears and go extension fails, the vscode test runner shows the test as running, and the stop button doesn't operate. vscode has to be relaunched to recover.

This use case suggests a deeper issue with extension error handling.

Steps to reproduce the behavior:

  1. Load a project with 2 or more unit tests that the vscode "Testing" panel can run, and can debug a single test
  2. At the top level container in Testing panel, click the Debug Test icon to attempt to run all the tests with a debugger attached

Screenshots or recordings

vscode-go-test-runner

@gopherbot gopherbot added this to the Untriaged milestone Jan 23, 2022
@hyangah
Copy link
Contributor

hyangah commented Jan 25, 2022

Thanks for the report @jimsnab

Currently the code is written in a way to require users to act on the error message prompt (await vscode.window.showErrorMessage(...)). So, you will need to close the popup to bring the text explorer back to the initial state.

I see two issues involved here

  • Should we wait for vscode.window.showErrorMessage to be resolved? Maybe not.
  • Allow to debug multiple tests. At least, when debug/profile are requested in a single package level, we may consider package-level debugging.

cc @firelizzard18

@hyangah hyangah modified the milestones: Untriaged, On Deck Jan 25, 2022
@hyangah hyangah added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. go-test issues related to go test support (test output, test explorer, ...) labels Jan 25, 2022
@firelizzard18
Copy link
Contributor

Debugging multiple tests is definitely something I planned on. I was intending to do that after updating the old test support to use the new test explorer machinery. Unfortunately my day job leaves me very little time for side projects.

@firelizzard18
Copy link
Contributor

This is resolved in #3523. Debugging multiple tests within the same package works, and attempting to debug multiple tests within different packages will A) properly end the run and B) show an error in the UI:
image
image

@firelizzard18 firelizzard18 added the Go Companion Issues relating to the Go Companion extension label Oct 3, 2024
@firelizzard18 firelizzard18 self-assigned this Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go Companion Issues relating to the Go Companion extension go-test issues related to go test support (test output, test explorer, ...) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Done
Development

No branches or pull requests

4 participants