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

test: Remove test_ensure_mod_tests #3534

Conversation

JonathanWoollett-Light
Copy link
Contributor

@JonathanWoollett-Light JonathanWoollett-Light commented Mar 15, 2023

Changes

Remove test_ensure_mod_tests.

Reason

The current implementation of the test does not cover most error cases.

A full solution would need to consider the Rust AST. In the worst case a test gets included in coverage and raises the coverage slightly higher than it should be, this is not a significant impact.

The test does check some cases, this may be better than no test at all, however given the impact it is not significant enough to warrant the complication.

I also posted rust-lang/rust-clippy#10506.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

The current implementation of the test does not cover most error cases.

A full solution would need to consider the Rust AST. In the worst case
a test gets included in coverage and raises the coverage slightly
higher than it should be, this is not a significant impact.

The test does check some cases, this may be better than no test at all,
however given the impact it is not significant enough to warrant the
complication.

Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
@JonathanWoollett-Light JonathanWoollett-Light added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Mar 15, 2023
@roypat
Copy link
Contributor

roypat commented Mar 15, 2023

Actually (really sorry for investigating this so piece-wise), there seems to be cargo test -- --list that provides us with a list of all tests. Can we process this output somehow to make sure each test is in a tests module? Something like

cargo test --all --quiet -- --list --format=terse | grep -v <exclude list> | grep -v "::tests::"

might get us what we want

@JonathanWoollett-Light
Copy link
Contributor Author

We decided to go with #3530 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Fix Indicates a fix to existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants