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

Debug test configuration can't build test binary #104

Open
GrantFleming opened this issue Nov 21, 2024 · 0 comments
Open

Debug test configuration can't build test binary #104

GrantFleming opened this issue Nov 21, 2024 · 0 comments

Comments

@GrantFleming
Copy link

GrantFleming commented Nov 21, 2024

Note: I am talking about the vanilla "dap" debug test option that is registered (that I assume is supposed to debug the test file under the cursor) as opposed to the "debug an individual test" option.

Actions Taken

After installing nvim-dap-go (along with nvim-dap), while most debugging options work as expected, the "Debug test" option cannot build the test binary.

Steps to reproduce

  1. create a package containing one file and one test file
  2. ensure your cursor is in the test file
  3. :lua require('dap').continue()
  4. select option 6 - "Debug test"

What Happened

Received an error building the test binary due to undefined functions in the test (that are definitely defined in the same package).

Build Error: go test -c -o /Users/grant/Projects/gotest/__debug_bin1012801603 -gcflags all=-N -l /Users/grant/Projects/gotest/pkg/somepackage/somemoretests_test.go
# command-line-arguments [command-line-arguments.test]
pkg/somepackage/somemoretests_test.go:6:13: undefined: UpperIt
pkg/somepackage/somemoretests_test.go:14:13: undefined: UpperIt (exit status 1)

It appears that when you try to test a single file, the required go files are not supplied alongside the test file:

go test somefile_test.go somefile.go

What I Expected to Happen

The tests are built and run successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant