Closed Mourishitz closed 2 months ago
In my experience, this is usually caused by the command you specified not actually running, or crashing.
In your config, you set the command as vendor/bin/pest
(which is the default by the way so you don't have to set it) and explicitly set sail to disabled. So really nothing is wrong here that I can tell.
My guess, and sorry but I have to ask even if it sounds trivial, do you actually have pest installed in the project? Meaning, can you successfully run vendor/bin/pest
from the root directory and see the tests run? Does it run to completion?
Let me know if the command runs fine or if it fails, then I can try to help you out a bit more.
Sure! It is not trivial at all, could really be an issue if Pest was not configured properly..
Turns out it is a valid command
Also, I forgot to mention but I already tried variants of this command such as ./vendor/bin/pest
Ok thanks, my next guess is that there is an issue determining the project root maybe? I'm not familiar with AstroVims plugins, but maybe it has a projects style plugin or another plugin that is adjusting the working directory.
Check and see that your current working directory is the same as where you just ran that vendor/bin/pest --version
command. You can check this by typing :pwd
inside neovim with your test file open. It should output a path that should match the exact path that you are able to run vendor/bin/pest
from.
Yes sure, it may have something to do with it... I will read some of the Astrocore documentation but for now, the :pwd
command prints the exact path it should have..
Maybe the project root variable or reference used in the plugin is not the same, I will find that out and return it here.
Also hate to ask what seems like a silly question: When you run just vendor/bin/pest
via your shell to try and run your tests, does that work?
Sure it does! Here is an example of it running
Hmm. My next thought is to add log_level = vim.log.levels.DEBUG,
to your neotest config, and then tail the contents of ~/.local/state/nvim/neotest.log
to see what it says
Here ya go! I just updated it like that:
I just spit out the entire log file (all clear, just ran the command once) and its available on this gits: https://gist.github.com/Mourishitz/ad8127f8ec0a04a25a4e3727f2dc3d53
I just reproduced this on my end.
You'll need to pull the most recent version of this plugin which has the PR i submitted that closed out #7...
That should™ solve your problem.
Ah, this makes it clear to me:
invalid node type at position 196 for language php
That's happening because you're using the latest tree-sitter and not the latest (as of a couple hours ago) version of this repo. Update to the latest and you ought to I think maybe be good to go.
However, if you're using any heredocs with language injections, you'll instead want to pin tree-sitter to the older commit (as described by another user in #7) and then pin this plugin to the commit just before latest.
To be clear, that's stuff like
$someValue = <<<JSON
{ 'some': 'json here' }
JSON;
^ There's a tree-sitter bug right now that will cause neovim to segfault if you do that. =]
Heh, just realized @noreason beat me to responding - Thank you sir. :slightly_smiling_face:
Yeah, it kind of worked.. When I run it under cursor or file it goes perfect!
Now, for some reason it still logs out errors when trying to run tests for the project..
What I mean by "run tests for the project" is running on this command:
This might be some problem with my vim config.. I can close the issue for now (if it is ok to you guys)
I would like to really thank you for helping me out! It is working great
I keep my tests under {projectroot}/tests
, so I just have my "run project" keybind setup like this:
vim.keymap.set('n', '<leader>tr', function() require('neotest').run.run("tests") end)
Maybe using a relative path would work for you too? Either way, definitely seems outside of the scope of this issue, so I'm gonna call it closed.
Hey, I just installed the latest version of AstroNvim (which does support neotest on its community packages using Lazy).
I just overwrote the plugin like this:![image](https://github.com/V13Axel/neotest-pest/assets/97261428/4dd27300-7a70-4a39-8035-ea58ed600bd9)
Check the full file here
All of a sudden, it does not work properly and gives this output:
I've saw the issue #5 with similar problems, but those did not work for me.
can I at least get a hint of what could be causing that to pop up?