-
Notifications
You must be signed in to change notification settings - Fork 19
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
feature: only run test in package instead of go.mod root #228
Comments
I find out that my specified package is empty without any go files. So it will search up to directory of go.mod run Is this as expected? My expectation is running all tests in specified package. Relative code: https://github.com/fredrikaverpil/neotest-golang/blob/main/lua/neotest-golang/runspec/dir.lua#L44 |
Hi @damoye I'm not sure I understand the issue. Let's take this repo as an example.
The command that gets executed by Neotest/neotest-golang is:
Can you give an example lua command which exhibits substituting the package with |
@fredrikaverpil Hi, let's use my fork for example: https://github.com/damoye/neotest-golang/tree/subpackage_test Note that there is no test file in the root of First problemWhen I run Second problemWhen I run |
Thank you @damoye I can reproduce. Let me have a closer look at this. |
@fredrikaverpil Yes! It resolved my problems. Thansk a lot! |
Did you check docs and existing issues?
Is your feature request related to a problem? Please describe.
When I run
It will search up to go.mod and run
go test ./...
from directory of go.mod file.However I would like to run
go test ./...
only in my_package_folder.Neotest summary also only shows tests in my_package_folder instead of directory of go.mod file.
Describe the solution you'd like to see.
Only run all tests in specified package.
Maybe change
run_spec.cwd
fromgo_mod_folderpath
topos.path
in:https://github.com/fredrikaverpil/neotest-golang/blob/main/lua/neotest-golang/runspec/dir.lua#L63
Describe alternatives you've considered.
No
Additional context
No response
The text was updated successfully, but these errors were encountered: