Skip to content

Conversation

@phip1611
Copy link
Member

@phip1611 phip1611 commented Nov 18, 2025

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:

  • 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_unittests.sh
exists, there are valid reasons why people can not or even don't want to
use them.

By adding a new chv_testenv rustc config, we can conditionally only
activate tests when the ./scripts/ magic runs them.

@phip1611 phip1611 requested a review from a team as a code owner November 18, 2025 06:56
@phip1611 phip1611 self-assigned this Nov 18, 2025
@phip1611 phip1611 force-pushed the upstream-cargo-test branch 2 times, most recently from 2d1b352 to 2647724 Compare November 18, 2025 07:39
@phip1611 phip1611 changed the title Quality of Life Improvement: enable cargo test --workspace: #[cfg(chv_testenv)] Quality of Life Improvement: enable cargo test --workspace: via #[cfg(chv_testenv)] Nov 18, 2025
@phip1611 phip1611 linked an issue Nov 18, 2025 that may be closed by this pull request
3 tasks
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)'] }
Copy link
Member

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.

Copy link
Member

@likebreath likebreath left a 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]
@phip1611 phip1611 force-pushed the upstream-cargo-test branch from 86dd898 to 6c292ae Compare November 20, 2025 08:04
@likebreath likebreath added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@likebreath likebreath added this pull request to the merge queue Nov 20, 2025
Merged via the queue into cloud-hypervisor:main with commit 11d17fb Nov 20, 2025
44 of 45 checks passed
@phip1611 phip1611 deleted the upstream-cargo-test branch November 25, 2025 13:07
@phip1611 phip1611 linked an issue Dec 18, 2025 that may be closed by this pull request
13 tasks
phip1611 added a commit to phip1611/nixpkgs that referenced this pull request Jan 6, 2026
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]>
phip1611 added a commit to phip1611/nixpkgs that referenced this pull request Jan 6, 2026
phip1611 added a commit to phip1611/nixpkgs that referenced this pull request Jan 6, 2026
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]>
hustlerone pushed a commit to hustlerone/nixpkgs-kmscon-no-drm that referenced this pull request Jan 7, 2026
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]>
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 9, 2026
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]>
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 10, 2026
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]>
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 11, 2026
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]>
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 12, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code Quality: Lints, Developer Experience & Technical Debt [Tracking Issue] Clippy: Tighten lints

3 participants