Skip to content

The test adapter should ignore underscored packages #2908

Closed
@firelizzard18

Description

@firelizzard18

Given the following project:

  • go.mod
  • foo
    • foo_test.go
  • _bar
    • bar_test.go

If I run go test ./..., the underscored package (_bar) is skipped. I can run those tests by running go test ./_bar so they're not completely disabled, but ... evidently does not resolve underscored packages.

However the test resolver does resolve underscored packages. I think it's OK for underscored packages to appear in the test explorer, since Go does let you build/test those packages, but they should be skipped when running all tests. Though maybe there should be a setting to control whether they're resolved at all. If they are resolved but skipped, that would need to be handled by GoTestRunner.run IIRC. This issue is reproduced by this project.

$ go list ./...
underscore-test/foo

image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.go-testissues related to go test support (test output, test explorer, ...)

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions