nvim-neotest / neotest-plenary

MIT License
38 stars 12 forks source link

[Bug] Does not find 'minimal_init.vim' by default configuration #13

Open rcasia opened 11 months ago

rcasia commented 11 months ago

During the development of neotest-java, I encountered a problem when attempting to execute its tests with neotest-plenary. The tests failed to run as expected.

I was unable to use neotest-plenary until I explicitly specified the minimal_init file in the neotest-plenary configuration.

According to the documentation, neotest-plenary will glob for */minimal_init*, and I can find it on the source code. However I don't understand why it does not work as expected.

This is the error log when I don't explicitly set the min_init file in the config:

Testing:        /home/username/REPOS/neotest-java/tests/core/dir_filter_spec.lua
...l/share/nvim/plugged/plenary.nvim/lua/plenary/busted.lua:267: ./lua/neotest-java/core/root_finder.lua:1: module 'neotest.lib' not found:
        no field package.preload['neotest.lib']
        no file 'lua/neotest/lib.lua'
        no file 'lua/neotest/lib/init.lua'
        no file './neotest/lib.lua'
        no file '/__w/neovim/neovim/.deps/usr/share/luajit-2.1/neotest/lib.lua'
        no file '/usr/local/share/lua/5.1/neotest/lib.lua'
        no file '/usr/local/share/lua/5.1/neotest/lib/init.lua'
        ...
eruizc-dev commented 10 months ago

Did you happen to fix this? I ran into the same issue

rcasia commented 10 months ago

For now, I set min_init option in the config as described in the README documentation. I did not look further into it yet.

rcasia commented 10 months ago

Checked out the issue, and turns out we've got multiple minimal_init.vim files in some of the project subdirectories. I did expect that behavior, as these files are located within a directory ignored by Git. It also affects detecting tests, it includes all of them that are within git-ignored directories.

chipsenkbeil commented 8 months ago

I have a path of spec/minimal_init.lua and it doesn't seem to be picked up. I have to manually specify the absolute path to the init file.

Wondering if the glob it is doing is not looking in the root of my project's directory.

[EDIT]

Ah, it seems that calling setup with no arguments results in it not finding minimal_init.lua. If I don't call setup at all, it works fine, but then detects undesired minimal_init.lua from dependency plugins I download into a vendor directory also located at the root of my project. So I need a way to exclude certain paths.