Open steffsommer opened 1 year ago
I don't have a windows machine to test this on. Hopefully one of the latest commits should fix this now that gradlew
is used correctly. If not I'll see about setting up a VM or something
Thanks for responding so fast. Unfortunately the error persists despite the latest commits. I would like to try debugging as well, although I haven't developed for Neovim before. Could you please give me some pointers on how to set up my environment or links to documentation that could be helpful?
Aside from treesitter and the lua-ls language server, this plugin is useful
https://github.com/folke/neodev.nvim
Otherwise I didn't have any tooling or environments set up. It might be worth asking on the subreddit to get some recommendations from people who do this more often
I have found the issue and it is indeed inside neotest-java.
The generated command from neotest-java looks like this:
C:\\Users\\Steff\\code\\java_gradle_demo\\gradlew.bat test --tests 'com.steff.demo.DemoApplicationTests.*'
Neotest probably executes the command inside cmd and from what I've read it's often hard to tell what '
quoted strings do in cmd (It seems they should be avoided). Anyways, it works with double quotes:
C:\\Users\\Steff\\code\\java_gradle_demo\\gradlew.bat test --tests "com.steff.demo.DemoApplicationTests.*"
At first I did not notice that, because powershell quoting behaves like bash, contrary to cmd. I'm not sure whether the general quoting style could be using "
. Maybe the *
character gets expanded on Linux then and yields different results, but I would give checking that out back into your hands.
I don't think the * is expanded in bash, given it's in quotes. And I assume neotest uses bash to run its commands. I'll make the change when I get home and see if I can set up GitHub actions to run on different OS's
Ok I've switched to using " characters instead of '. Hopefully that fixes things
error/bug explanation
When executing tests on Windows in a minimal project
Neotest says there are no tests available with the following error message:
The include Filter is correct, so there is nothing suspicious. Then I looked at the Neotest log and the generated command looks also correct:
cwd
andcommand
are both correct. I can even execute the command in PowerShell and it works. Not sure if this is a problem from your adapter or from Neotest.Reproducer Repo, but only works when this issue is resolved, because it contains a
build.gradle.kts
file.full log