Skip to content

code lens: support running and debugging tests that use http://labix.org/gocheck #111

Open
@ramya-rao-a

Description

@ramya-rao-a

Tests that use the check package can be run as part of the whole package or file but not individually in VS Code.

This feature request is to support the below for individual tests using the check package in VS Code

  • Go: Test function at cursor command
  • Run Tests codelens
  • Debug Tests codelens

For more, including hints on how to go about this, please see microsoft/vscode-go#1921 & microsoft/vscode-go#3222

Activity

added
HelpWantedIssues that are not prioritized by the maintainers. Help is requested from community contributors.
on May 28, 2020
stamblerre

stamblerre commented on Jun 3, 2020

@stamblerre
Contributor

I would be curious to know how many people want this change before we implement it. Please upvote #111 (comment) if you would use this feature.

changed the title [-]Support codelens to run and debug tests supported by the check package[/-] [+]code lens: support running and debugging tests that use http://labix.org/gocheck[/+] on Jun 3, 2020
stamblerre

stamblerre commented on Jun 8, 2020

@stamblerre
Contributor

Similarly, there have been mentions on Slack of the code lenses not working with Testify-based tests.

ramya-rao-a

ramya-rao-a commented on Jun 10, 2020

@ramya-rao-a
ContributorAuthor

Code lens support for testify based tests was added in microsoft/vscode-go#1707. So, if they are not working anymore, that is a regression.

tgturner

tgturner commented on Jun 16, 2020

@tgturner

I worked on an initial implementation. It was closed during the migration to the golang org. It's no longer in sync with master but might be a good starting off point for someone.

microsoft/vscode-go#3222

I'll try to get back to it and open the PR here because its a feature that I would really like to have, but if someone gets to it first I will not be offended.

hyangah

hyangah commented on Jun 16, 2020

@hyangah
Contributor

@tgturner Thanks. Do you have any thought on my comment in #228 (comment)?

tylfin

tylfin commented on Jun 30, 2020

@tylfin

I opened a duplicate issue here: #274

Like I mentioned in that issue, it would be nice to either:

  • make this code generic and allow for configuration overrides OR
  • make this code extensible such that any third-party test suites need to be implemented separated e.g. testify, check.v1 and any future test suites

That way VS Code Go isn't discouraging developers from building new or different test suites packages due to lack of tooling.

If that sounds like overkill, I'm happy to extend the existing code to include check.v1

EDIT: I created a small fork that should solve this for folks running into issues YMMV https://github.com/tylfin/vscode-go-check

added this to the Untriaged milestone on Apr 8, 2021
modified the milestones: Untriaged, Backlog on Apr 9, 2021
jcalabro

jcalabro commented on May 11, 2021

@jcalabro

Hi all! I've opened a PR here for review (it simply extends the existing code to support check.v1, not any other test suites at this time). Thanks!

#1494

hyangah

hyangah commented on May 11, 2021

@hyangah
Contributor

We hoped that we stop supporting third-party test libraries and move away from the GoDocumentSymbolProvider. The underlying tool for GoDocumentSymbolProvider is in maintenance mode and this go extension uses gopls document symbol providers. The third-party test code lens support is one of few remaining cases that are blocking deprecation.

Have you considered a separate, specialized extension for users who want to use all those test frameworks? If necessary, the extension can invoke the document symbol provider command and can create a code lens that invokes go extension's commands to run/debug tests too.

modified the milestones: Backlog, Untriaged on May 11, 2021
added
go-testissues related to go test support (test output, test explorer, ...)
on Jun 7, 2022
firelizzard18

firelizzard18 commented on Oct 3, 2024

@firelizzard18
Contributor

With test discovery moving to gopls, this will need to be handled there.

added
goplsgopls related issues
Go CompanionIssues relating to the Go Companion extension
on Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestGo CompanionIssues relating to the Go Companion extensionHelpWantedIssues that are not prioritized by the maintainers. Help is requested from community contributors.go-testissues related to go test support (test output, test explorer, ...)goplsgopls related issues

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

      Participants

      @firelizzard18@tylfin@hyangah@stamblerre@jcalabro

      Issue actions

        code lens: support running and debugging tests that use http://labix.org/gocheck · Issue #111 · golang/vscode-go