Closed nerdo closed 1 year ago
Same issue here
I can't reproduce. Does this happen with a minimal example or only with some files?
I can't reproduce. Does this happen with a minimal example or only with some files?
I tried to make minimal example, Is this same error? https://github.com/ShortArrow/PoC_neotest_rust_issue_20
I can't reproduce. Does this happen with a minimal example or only with some files?
I tried to make minimal example, Is this same error? https://github.com/ShortArrow/PoC_neotest_rust_issue_20
Thanks, I can reproduce with that! I'm not sure when I'll have time to look into this more, but this is a huge help!
I can't reproduce. Does this happen with a minimal example or only with some files?
I tried to make minimal example, Is this same error? https://github.com/ShortArrow/PoC_neotest_rust_issue_20
Oh, this issue here is that the build fails, not the test, so there is not result file. I hadn't considered that.
Maybe the same issue? #22
I may have just found a clue:
or, in lay and text terms:
[?25l[2J[m[91m[1m[Herror[m: failed to parse nextest config at C:\Users\sias.mey\AppData\Local\Temp\nvim.0\WFp1tH\1.nextest.toml
[3;1HCaused by:
invalid hex escape character in string: s
at line 2 column 13 in ................\Temp\nvim.0\WFp1tH\1.nextest.toml
]0;C:\WINDOWS\SYSTEM32\cmd.exe[?25h
I actually have this happen with the test project in the plugin itself. It does make sense though if the underlying cause is a failure to read the config.
Wel wel wel wel... windows, what have you done now.
[profile.neotest.junit] path = "C:\Users\sias.mey\AppData\Local\Temp\nvim.0\WFp1tH\2.junit.xml"
or, rather...
Omg... seriously.
Fixed:
I will do a PR tomorrow, I cant test on other OS, but this makes it work for me in windows.
Just swapping " for ' in the config toml
Line 135 of lua/init.lua
Oh, interesting.
I'll see if I can make a similar tweak on my system (macos) and see if it works - time permitting. Will respond as soon as I can.
That seems to fix it for me too. I was able to run a test with that change in place!
I’d love a PR with the fix and ideally a new test!
I should have some time this weekend; I will try and do a PR if SiasMay doesn't get to it first.
My week exploded, sorry.. But I am very glad that it seems I got to the root cause of the issue for a few folks.
We should probably report upstream, since I am not sure the intent of config parsing should be to allow escape sequences like that. At least, for the moment we know that ' is much safer than " in situations like this.
No worries, I totally understand.
I submitted a PR (https://github.com/rouge8/neotest-rust/pull/24)
@rouge8 I didn't add tests because I'm unfamiliar with the process in lua and couldn't get make test
to run properly in an unmodified repo (details in the PR).
On Arch linux.
I was tried inject this.
writer:write("[profile.neotest.junit]\npath = '" .. junit_path .. "'")
print("[profile.neotest.junit]\npath = '" .. junit_path .. "'")
result was here.
[profile.neotest.junit]
path = "/tmp/nvim.who/2yVsIM/10.junit.xml"
Error executing vim.schedule lua callback: ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: ...e/nvim/lazy/plenary.nvim/lua/plenary/context_manager.lua:47: /tmp/nvim.who/2yVsIM/10.junit.xml: No such file or directory
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function <...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:44>
Therefore, it seems that the escape character is not the cause of not being able to find a file in Linux.
I have two hypotheses.
.junit.xml
file..junit.xml
file is generatedIf "no file is generated" has expected behavior then, skip .junit.xml
and need to make load feature 11
file or 2
,5
,8
.
I want to make a PR if possible. But don't expect me. I have just started using Lua language. Of course I will make an effort.
@ShortArrow I believe what you are seeing is something different from the issue resolved by the quote changes. The result may be the same error, but the cause is totally unrelated.
What we could possibly do in such a case, is output a junit result file that indicated all tests failed due to a compiler issue, but as I said above, that is a little beyond the issue I was experiencing.
That does still happen to me regularly though, I am not good enough at rust yet to avoid all the compilation errors.
I can't reproduce. Does this happen with a minimal example or only with some files?
I tried to make minimal example, Is this same error? https://github.com/ShortArrow/PoC_neotest_rust_issue_20
Oh, this issue here is that the build fails, not the test, so there is not result file. I hadn't considered that.
Failing builds will now no longer crash and will now display the build output.
The single vs double quote thing might be an issue with Windows paths? If someone can reproduce it on non-Windows, I might take a look.
I can't seem to get this working. When I run a test, I get an error saying that a file
3.junit.xml
doesn't exist.I searched for the issue and saw that someone reported an issue with it but they didn't have
cargo-nextest
installed. I do, v0.9.48.Did I misconfigure something?