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

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

Open
rcasia opened this issue Nov 5, 2023 · 4 comments
Open

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

rcasia opened this issue Nov 5, 2023 · 4 comments

Comments

@rcasia
Copy link

rcasia commented Nov 5, 2023

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
Copy link

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

@rcasia
Copy link
Author

rcasia commented Nov 10, 2023

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
Copy link
Author

rcasia commented Nov 11, 2023

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
Copy link

chipsenkbeil commented Jan 15, 2024

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.

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

3 participants