-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I run necessist with nextest? #935
Comments
Thanks. :)
Currently, it is hardcoded to use necessist/frameworks/src/rust/mod.rs Lines 550 to 551 in cade466
Does your project require |
It'd be preferred to use
If there's a way to pass arguments to |
BAD ADVICE. See below.
Aside: I'm not opposed to using alternate test runners. But my understanding is that the main benefit to using |
Thank you. I will try it. Based on what you describe, I think the command should be # cargo test testnet -- --test-threads=1
necessist -- testnet -- --test-threads=1 Edit: The reason I am asking to verify the command is because I want to filter which tests to run, via
And the equivalent in
If this is a bug, I can move it into its own issue. |
To filter which tests are run, please try passing a list of test files to Necessist, e.g.:
This interface is a consequence of wanting to support multiple languages. But I now see that it can be confusing. I'm not sure what the best "fix" is. Maybe a warning could be issued if the additional arguments match some pattern (e.g., contain Updated following #935 (comment). |
Thanks! That worked! Thank you for all the help. This issue can be closed now. Given all the above, there are errors/warnings when running the tool against a fairly sized codebase (stacks-core), and I am happy to open a separate issue if you think I should.
|
Is the code publicly available so that I might try to reproduce the issue? If not, do you experience similar behavior with some other code (e.g., in the linked repository)? |
Thank you for asking. Of course, here's how you can reproduce it: # Install package dependencies (skip if you already have them):
sudo apt install build-essential libclang-dev pkg-config libssl-dev
# Install Rust (skip if you already have it):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
# Clone stacks-core, cd into it, switch to `next` branch:
git clone https://github.com/stacks-network/stacks-core.git && cd stacks-core
git checkout next
# Run `pox_4_tests` via `cargo test`:
cargo test --package stackslib --lib -- chainstate::stacks::boot::pox_4_tests
# Run `pox_4_tests` via `necessist`:
necessist ./stackslib/src/chainstate/stacks/boot/pox_4_tests.rs \
-- --package stackslib -- chainstate::stacks::boot::pox_4_tests
This is the first time I had a chance to use this very interesting tool. |
I think this command may do what you want: necessist stackslib/src/chainstate/stacks/boot/pox_4_tests.rs \
-- --package stackslib chainstate::stacks::boot::pox_4_tests
# ^ No `--` here. I gave you bad advice. The double Fortunately, Aside: |
Thank you! That command executed fine. Now, how do you I interpret the output of
|
I'm really glad to hear that.
All the output tells you is that if you remove those statements/method calls, the tests still pass. So giving a direct answer to your question ("each I suspect that these are false positives and can be ruled out immediately:
In other words, it's not surprising for a test to still pass if it prints less information (the former) or performs fewer assertions (the latter). This one looks more suspicious:
It seems to suggest that the BTW, you might consider creating a necessist.toml file with the following content: ignored_functions = ["assert_latest_was_burn"]
ignored_macros = ["info"] Doing so will eliminate many of those likely false positives, and will make Necessist finish sooner. |
What a great tool 👍 💯
When using
necessist
in Rust, is it agnostic when it comes to the underlying test runner? I'd be interested to run this on a project where tests are run viacargo nextest run
.The text was updated successfully, but these errors were encountered: