Skip to content

ch: detect VMM version from git repository for Docker-based tests#4256

Open
vyadavmsft wants to merge 1 commit intomainfrom
vyadav_jan_fix3
Open

ch: detect VMM version from git repository for Docker-based tests#4256
vyadavmsft wants to merge 1 commit intomainfrom
vyadav_jan_fix3

Conversation

@vyadavmsft
Copy link
Collaborator

Problem:

Cloud-hypervisor performance tests report VMM version as 'UNKNOWN' instead of actual version (e.g., '48.0.235'). Tests run cloud-hypervisor inside Docker containers which are build environments without pre-compiled binaries, making binary-based version detection unreliable.

Root Cause:

  1. Tests execute cloud-hypervisor by compiling from source inside Docker build containers
  2. Previous version detection attempted to query non-existent binaries in Docker images
  3. Version detection ran during teardown when SSH session was closing, causing failures

Solution:

  1. Primary: Extract version from git repository where tests clone cloud-hypervisor source
    • Uses 'git describe --tags' matching how tests report version metadata
    • Handles patterns: 'msft/v48.0.235', 'v48.0.235-7-g6fed5f8e7'

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Cloud Hypervisor performance test metadata reporting by improving how the cloud-hypervisor VMM version is detected and made available to platform/environment information collection (especially for Docker-based tests that build from source).

Changes:

  • Enhance get_vmm_version() to prefer a cached value, then fall back to local binary version output, then to git describe from the cloned repo.
  • Cache the detected VMM version during CloudHypervisorTests tool installation for later use by platform information hooks.
  • Update Cloud Hypervisor test case signatures to accept Environment (framework injection alignment).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
lisa/sut_orchestrator/platform_utils.py Adds cached + git-repo-based VMM version detection logic.
lisa/microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py Caches detected VMM version post-install for later metadata collection.
lisa/microsoft/testsuites/cloud_hypervisor/ch_tests.py Adds Environment parameter to CH test cases for framework injection consistency.
**Key Test Cases:**
verify_cloud_hypervisor_performance_metrics_tests|verify_cloud_hypervisor_integration_tests

**Impacted LISA Features:**
Virtualization

**Tested Azure Marketplace Images:**
- canonical 0001-com-ubuntu-server-jammy 22_04-lts latest
- microsoftcblmariner azure-linux-3 azure-linux-3 latest

@vyadavmsft vyadavmsft force-pushed the vyadav_jan_fix3 branch 3 times, most recently from 307db8b to f00b53e Compare January 30, 2026 06:31
@LiliDeng
Copy link
Collaborator

LiliDeng commented Feb 2, 2026

@copilot please rebase the latest main into this branch.

Copy link
Contributor

Copilot AI commented Feb 2, 2026

@LiliDeng I've opened a new pull request, #4258, to work on those changes. Once the pull request is ready, I'll request review from you.

@vyadavmsft
Copy link
Collaborator Author

please rebase the latest main into this branch.

i did the rebase.

@vyadavmsft
Copy link
Collaborator Author

@LiliDeng can you check this , something not right with pr checks

"UNKNOWN",
)
if cached_version and cached_version != "UNKNOWN":
node.log.debug(f"Using cached VMM version: {cached_version}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For azure platform, it is expected to see unknown, the cached version doesn't work on azure platform.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok , is there anything specific you are asking to change ? im not clear with your comment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to find a way to distinguish between platforms or perform the check only on platforms that do not have a VMM version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 64: Now uses cached "UNKNOWN" values (removed the != "UNKNOWN" check)
Line 129: Now caches "UNKNOWN" results at the end.

this should remove overhead, First test checks once and caches "UNKNOWN" and next tests use cache.

@vyadavmsft vyadavmsft requested a review from LiliDeng February 6, 2026 19:04
Problem:

Cloud-hypervisor performance tests report VMM version as 'UNKNOWN' instead of actual version (e.g., '48.0.235'). Tests run cloud-hypervisor inside Docker containers which are build environments without pre-compiled binaries, making binary-based version detection unreliable.

Root Cause:

1. Tests execute cloud-hypervisor by compiling from source inside Docker build containers

2. Previous version detection attempted to query non-existent binaries in Docker images

3. Version detection ran during teardown when SSH session was closing, causing failures
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.

3 participants