Closed Maduki-tech closed 6 months ago
First thing I see is the version of your junit_jar is 1.10.1
in contrast with your project dependency 5.10.1
.
It is failing to generate the test report file because something went wrong in the test execution.
Can you share the output after a test run?
require("neotest").output_panel.open()
I have the same issue.
First thing I see is the version of your junit_jar is
1.10.1
in contrast with your project dependency5.10.1
.
well, this is the latest version for everything. Do you mean I need to downgrade from 5.10.1 to 1.10.1 in my project?
when I run require("neotest").output_panel.open() this is my error
bash: line 0: globstar: invalid shell option name
well, this is the latest version for everything. Do you mean I need to downgrade from 5.10.1 to 1.10.1 in my project?
@Maduki-tech I apologize for the oversight. Your versions were correct.
It seems that the problem was that your bash version does not support globstar
option (versions before 4).
To avoid that I removed all the globs from the command.
@JonaLoeffler you seem to have a different issue.
Have you tried to run gradle build
or mvn compile
and run the tests again?
@rcasia amazing, this fixed my error. THX
@JonaLoeffler you seem to have a different issue.
Have you tried to run
gradle build
ormvn compile
and run the tests again?
@rcasia I did and it's all green, now with the latest plugin updates I get
cat: build/neotest-java/classpath.txt: No such file or directory
error: --class-path requires an argument
Usage: javac <options> <source files>
use --help for a list of possible options
The statusline briefly shows src/test/java is not accessible by the current user!
, then Error reading file: /tmp/neotest-java/<some kind of id>/TEST-junit-jupiter.xml
This is my Lazy config for neotest:
return {
{
'rcasia/neotest-java',
ft = 'java',
dependencies = {
'nvim-neotest/neotest',
dependencies = {
'nvim-neotest/nvim-nio',
'nvim-lua/plenary.nvim',
'antoinemadec/FixCursorHold.nvim',
'nvim-treesitter/nvim-treesitter',
},
opts = {
adapters = {
['neotest-java'] = {
ignore_wrapper = false, -- whether to ignore maven/gradle wrapper
},
},
},
},
config = function()
require('neotest').setup {
adapters = {
require 'neotest-java' {
ignore_wrapper = false, -- whether to ignore maven/gradle wrapper
},
},
}
vim.keymap.set('n', '<leader>tp', function()
require('neotest').run.run(vim.uv.cwd())
end, { desc = '[T]est [P]project', noremap = true })
vim.keymap.set('n', '<leader>tf', function()
require('neotest').run.run(vim.fn.expand '%')
end, { desc = '[T]est [F]ile', noremap = true })
vim.keymap.set('n', '<leader>tr', function()
require('neotest').run.run()
end, { desc = '[T]est [R]un', noremap = true })
vim.keymap.set('n', '<leader>ts', function()
require('neotest').run.stop()
end, { desc = '[T]est [S]top', noremap = true })
vim.keymap.set('n', '<leader>ta', function()
require('neotest').run.attach()
end, { desc = '[T]est [A]ttach', noremap = true })
vim.keymap.set('n', '<leader>to', function()
require('neotest').output.open()
end, { desc = '[T]est output [O]pen', noremap = true })
end,
},
}
build/neotest-java/classpath.txt
does exist in the working directory, but is empty.
Version v.1.10.0
is still working for me though.
how is your project structure? does src/test/java
exist?
No, it consists of a number gradle sub-projects like com.company.app.web.server.<component>
for about 10 components. Each of these then has src/test/java
.
I see... It is a problem running tests in multimodule projects. Can you open a different issue, pls? I will be on it as soon as posible.
Done, #100.
No worries, everything is still working flawlessly when I pin the plugin version to v1.10.0.
Thanks for the great work!
Hello,
my project setup is:
This is my neotest config:
Im also running the command:
My error is the following:
Error reading file: /tmp/neotest-java/240424215135/TEST-junit-jupiter.xml
Also when I try to look at the file, there is no
neotest-java
file in my/tmp/
dir.Can someone help me with this error? If something is missing which you need to know, let me know!