Closed antonpetrovmain closed 1 year ago
I've found the cause of this. Treesitter parses the package name as an identifier
when there's only one level of nesting e.g. mypackage
but as a scoped_identifier
when there's more than that e.g. mypackage.mysubpackage
. I never tested with nested packages so I never found the problem. Just working on test cases and a fix now
Hopefully this should be addressed in the latest commit
Works great, thank you so much for the quick fix!
There is some issue with the results interpreted by
neotest
from theneotest-java
adapter. Whenever the test has a non-default package, e.g.com.example.demo.service.TransferServiceTest
the results contain that fqcn (fully qualified class name) (which looks very logical), but theneotest
adds new entries to the result (and fails them), which contain only the classname + method:results from neotest-java:
results after
neotest
processes the above table:It seems that
neotest
is looking at some paths and does not respect packages. The end result is that the test is marked as failed, even though it has passed.As a workaround, I have modified
neotest-java
to use thesimple class name + method name
format. The only drawback I see from this is if I have the sameTransferServiceTest
test in 2 different packages, the test results will be wrong (something I can live with, since I rarely (if ever) need to have the absolute same test+methods in two different packages). e.g., if I copy com.example.demo.service.TransferServiceTest to com.example.demo.model.TransferServiceTest (and fail the test method in that new test class) the results will be wrong.Here is the modification I have made locally with which things are working fine: in
buf 8: "~/.local/share/nvim/lazy/neotest-java/lua/neotest-java/init.lua" 328 lines --82%--