Skip to content
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

cargo test does not give any warning when the specific test case does not exist #14813

Closed
yipu3 opened this issue Nov 13, 2024 · 1 comment
Closed
Labels
C-bug Category: bug Command-test S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

Comments

@yipu3
Copy link

yipu3 commented Nov 13, 2024

Problem

If I run cargo test xxx when xxx does not exist. cargo does not give any warning but output a bunch of green output.

For example. I have a test case test_foo. Every time I change foo I run this test case by running cargo test test_foo. Then I change the name from test_foo to test_foo_ and forget to change the test command(For example, by using bash history). So every time I run cargo test I still got a bunch of green output which make me take the test as passed for granted, causing more confusion in the future.

Steps

cargo test xxx
xxx is a non-existing test case

Possible Solution(s)

Give warnings if the test case does not exist.

Notes

No response

Version


@yipu3 yipu3 added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Nov 13, 2024
@weihanglo
Copy link
Member

Thanks for the proposal.

This is a duplicate of #11875, and is not a thing Cargo can control at this moment.

rust-lang/testing-devex-team#1 is an effort of providing a JSON output so that Cargo and other tools may have more chances to control how tests are executed.

Close in favor of aforementioned issues.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
@weihanglo weihanglo added Command-test S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix and removed S-triage Status: This issue is waiting on initial triage. labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Command-test S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Projects
None yet
Development

No branches or pull requests

2 participants