Comments (10)
@rouge8 Same here
It seems the right command should be
cargo test
notcargo nextest
No, that's not correct. As it says in the README, this plugin works with cargo-nextest.
from neotest-rust.
Can you provide an example that triggers this?
from neotest-rust.
I was running this simple code:
#[cfg(test)]
mod tests {
#[test]
fn test() {
let mut i: u8 = 255;
i += 1;
}
}
For some reason, it works now.
from neotest-rust.
Sorry for the last post, this test fails:
#[cfg(test)]
mod tests {
#[test]
fn test() {
let mut i: u8 = 255;
i = i.wrapping_add(1);
assert_eq!(i, 0);
}
}
from neotest-rust.
Seems to work for me, running neotest on this main.rs
:
fn main() {
println!("Hello, world!");
}
#[cfg(test)]
mod tests {
#[test]
fn test() {
let mut i: u8 = 255;
i = i.wrapping_add(1);
assert_eq!(i, 0);
}
}
from neotest-rust.
@tubzby , did you try installing cargo-nextest
with cargo install cargo-nextest --locked
? I was getting the same error but that fixed it.
from neotest-rust.
It works now, I'm not sure what happened, sometimes when I run a test with key bindings, nothing happens, I have to switch to vs code to run the unit test.
Are there any logs that I can look into?
from neotest-rust.
@rouge8 Same here
It seems the right command should be cargo test
not cargo nextest
from neotest-rust.
yes thank you, doing cargo install nextest
seems to do the trick
from neotest-rust.
@rouge8 Hello!
I'v faced the same problem, at least the error I receive is the same as OP, but in my case I found out the reason.
I copied args for initialization from example:
require("neotest").setup({
adapters = {
require("neotest-rust") {
args = { "--no-capture" },
}
}
})
That lead to cargo launches with args like
cargo nextest run --no-fail-fast --config-file /var/folders/0y/gvl9x07x341fhm6zq23ps9480000gn/T/nvim.coin/ROMNaO/0.nextest.toml --profile neotest --no-capture -E 'test(/^tests::/)'
And --no-capture lead to empty system-out/system-err nodes in xml result:
<testcase name="tests::test_ref" classname="lobster-proxy::bin/lobster-proxy" timestamp="2023-08-12T22:26:57.410+00:00" time="0.004">
<failure type="test failure"/>
<system-out></system-out>
<system-err></system-err>
</testcase>
so the input to parse_errors method become nil.
I guarded with simple precheck for nil in local version like:
function M.parse_errors(output)
if output == nil then
return {}
end
local message, line = output:match("thread '[^']+' panicked at '([^']+)', [^:]+:(%d+):%d+")
<...>
It really took me a while, cause at the beginning I did know nothing about lua.
PS May be OP has another source of the problem, but i smashed my head a bit, before figuring out. Should I make a PR or it works like that by design?
from neotest-rust.
Related Issues (20)
- Support workspaces
- neotest-rust is getting called instead of neotest-python
- Tests with `#[should_panic]` macro are ignored HOT 1
- Error attempt to get length of field 'testsuite' (a nil value) HOT 1
- Unable to parse the test HOT 4
- No Tests found HOT 4
- Tests are not detected if comment exists after #[test] attribute
- Package name should be read from `Cargo.toml` HOT 4
- Running a single test fails HOT 2
- Running/listing tests in a workspace with a root package fails HOT 3
- Running a single test breaks on fish
- Low performance in a large codebase and multi-crate workspace HOT 3
- Test cases from /target folder are extracted unnecessarily HOT 1
- Debug fails because `file_path` is nil HOT 4
- Running file doesn't work HOT 4
- Investigate using Nextest's experimental machine-readable JSON output instead of junit XML
- Feature request: watch support
- Issues with workspaces HOT 11
- Support for doctests?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neotest-rust.