Issue: Test(s) not associated (not found/executed) #161
-
Did you check docs and existing issues?
Neovim version (nvim -v)0.10.0 Operating system/versionUbuntu 22.04.4 LTS Output from
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 24 replies
-
Hey there, Hm, so first off I can tell that your I've done that below, and also added in logging setup: return {
"nvim-neotest/neotest",
event = "VeryLazy",
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
{
"fredrikaverpil/neotest-golang",
dependencies = {
"leoluz/nvim-dap-go",
},
branch = "main",
},
},
config = function()
-- set up Neotest
require("neotest").setup({
adapters = {
require("neotest-golang"),
},
})
-- set up logging
local log_level = vim.log.levels.DEBUG
require("neotest.logging"):set_level(log_level)
vim.notify("Logging for Neotest enabled", vim.log.levels.WARN)
local filepath = require("neotest.logging"):get_filename()
vim.notify("Neotest log file: " .. filepath, vim.log.levels.INFO)
end,
} This should show you both that logging is enabled and the path to the file. Do you still not see anything printed to the log file? Do you have a separate lua configuration for Neotest? A question mark next to the test means it hasn't run, or that it ran but there was no output from By the way, if you clone down this repo, you should be able to run the Go tests inside without issues. Can you do that? EDIT: I updated the above snippet so to set up logging after loading neotest. |
Beta Was this translation helpful? Give feedback.
-
Attached is the logs from a single file test of neotest-golang/tests/go/positions_test.go with gotestsum. I think you're right go list -json ./... seems to show nothing based on the attached logs: DEBUG | 2024-08-07T19:49:17Z-0700 | .../nvim/lazy/neotest-golang/lua/neotest-golang/logging.lua:52 | [neotest-golang] Running Go list: go list -json ./... in /home/hussein/go/src/neotest-golang/tests/go How could this line possibly returns nothing: which is odd because I can clearly see |
Beta Was this translation helpful? Give feedback.
-
Hi there, I'm encountering the same warning message when running the entire test suite with neotest-go. The message is:
This happens specifically when I use the run.run({ suite = true }) command. However, when I run individual test packages from the Neotest Summary using the run action, everything works as expected. My project structure is as follows: ├── cmd/
│ └── sitetrace/
│ └── main.go
├── config/
├── go.mod
├── go.sum
├── internal/ # Contains application packages
│ └── ... (various subdirectories)
├── tests/ # Contains integration tests
│ ├── api/
│ └── helper/ As you can see, I don't have any .go files directly in the project root directory. Through experimentation, I discovered that creating a dummy.go in the root allows the Therefore, my question is: Is it mandatory to have a .go file at the root of the project for neotest-go to recognize and run the entire test suite with? |
Beta Was this translation helpful? Give feedback.
Update: I figured it out the go bin installed via ubuntu snaps don't print to stdout when called from nvim, the exit code from jobstart is 0, but nothing outputed to stdout/stderr.
I had to download a go tarball and that fixed it. Thank you for your patience. Good call with the
go list