-
Notifications
You must be signed in to change notification settings - Fork 565
Quality of Life Improvement: enable cargo test --workspace: via #[cfg(chv_testenv)]
#7487
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
Quality of Life Improvement: enable cargo test --workspace: via #[cfg(chv_testenv)]
#7487
Conversation
2d1b352 to
2647724
Compare
cargo test --workspace: via #[cfg(chv_testenv)]
Cargo.toml
Outdated
|
|
||
| [workspace.lints.rust] | ||
| # `level = warn` is irrelevant here but mandatory for rustc/cargo | ||
| unexpected_cfgs = { level = "warn", check-cfg = ['cfg(chv_testenv)'] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea - but can I suggest "devcli_testenv" as the name - I think it's a more descriptive name of the test environment and also reflects when it gets set.
likebreath
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your investment of time in improving the developer experience. 👍
TL;DR: Massive quality of life improvement for devs Cloud Hypervisor uses the Cargo test framework for multiple tests: - normal unit tests - unit tests requiring special environment (the Tap device tests) - integration tests requiring a special environment This prevented the execution of `cargo test --workspace`, which results in a very poor developer experience. Although `./scripts/run_unit_tests.sh` exists, there are valid reasons why devs cannot or even don't want to use it. By adding a new `chv_testenv` rustc config, we can conditionally only activate tests when the `./scripts/` magic runs them. This improves the general developer experience by a lot. Signed-off-by: Philipp Schuster <[email protected]> On-behalf-of: SAP [email protected]
This better aligns with the rest of the code and makes it clearer that these tests can run "as is" in a normal hosted environments without the special test environment. Signed-off-by: Philipp Schuster <[email protected]> On-behalf-of: SAP [email protected]
Signed-off-by: Philipp Schuster <[email protected]> On-behalf-of: SAP [email protected]
Signed-off-by: Philipp Schuster <[email protected]> On-behalf-of: SAP [email protected]
Signed-off-by: Philipp Schuster <[email protected]> On-behalf-of: SAP [email protected]
Signed-off-by: Philipp Schuster <[email protected]> On-behalf-of: SAP [email protected]
86dd898 to
6c292ae
Compare
11d17fb
Since v50.0, Cloud Hypervisor unit test "just works" without restrictions [0]. [0] cloud-hypervisor/cloud-hypervisor#7487 On-behalf-of: SAP [email protected] Signed-off-by: Philipp Schuster <[email protected]>
[0] cloud-hypervisor/cloud-hypervisor#7487 On-behalf-of: SAP [email protected] Signed-off-by: Philipp Schuster <[email protected]>
I want to help keep libvirt updated, as it is often quite behind. I work actively with libvirt as part of my virtualization work at Cyberus Technology. [0] cloud-hypervisor/cloud-hypervisor#7487 Signed-off-by: Philipp Schuster <[email protected]>
I want to help keep libvirt updated, as it is often quite behind. I work actively with libvirt as part of my virtualization work at Cyberus Technology. [0] cloud-hypervisor/cloud-hypervisor#7487 Signed-off-by: Philipp Schuster <[email protected]>
I want to help keep libvirt updated, as it is often quite behind. I work actively with libvirt as part of my virtualization work at Cyberus Technology. [0] cloud-hypervisor/cloud-hypervisor#7487 Signed-off-by: Philipp Schuster <[email protected]>
I want to help keep libvirt updated, as it is often quite behind. I work actively with libvirt as part of my virtualization work at Cyberus Technology. [0] cloud-hypervisor/cloud-hypervisor#7487 Signed-off-by: Philipp Schuster <[email protected]>
I want to help keep libvirt updated, as it is often quite behind. I work actively with libvirt as part of my virtualization work at Cyberus Technology. [0] cloud-hypervisor/cloud-hypervisor#7487 Signed-off-by: Philipp Schuster <[email protected]>
I want to help keep libvirt updated, as it is often quite behind. I work actively with libvirt as part of my virtualization work at Cyberus Technology. [0] cloud-hypervisor/cloud-hypervisor#7487 Signed-off-by: Philipp Schuster <[email protected]>
TL;DR: Massive quality of life improvement for devs
Please review this commit-by-commit.
Cloud Hypervisor uses the Cargo test framework for multiple tests:
This prevented the execution of
cargo test --workspace, which resultsin a very poor developer experience. Although
./scripts/run_unittests.shexists, there are valid reasons why people can not or even don't want to
use them.
By adding a new
chv_testenvrustc config, we can conditionally onlyactivate tests when the
./scripts/magic runs them.