Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f98d759
flowey: add ability to query artifacts for tests being run and only b…
chris-oo Jan 15, 2026
dd1f932
flowey: meta command, remove mimic filter
chris-oo Jan 16, 2026
2d0f7fa
flowey: remove nested somes
chris-oo Jan 16, 2026
db026a1
flowey: add vmm-tests-run command to only download artifacts for spec…
chris-oo Jan 20, 2026
e2865b1
flowey: add --skip-vhd-prompt command
chris-oo Mar 31, 2026
533404e
flowey: add --skip-vhd-prompt to vmm-tests-run
chris-oo Mar 31, 2026
3b06559
flowey: add build-essential dep to artifact discovery
chris-oo Mar 31, 2026
8cbceae
flowey: check artifacts pass on each target
chris-oo Mar 31, 2026
371a87a
flowey: add tpm artifact
chris-oo Apr 1, 2026
2f26ac1
feedback round 1
chris-oo Apr 1, 2026
b097542
feedback: plans to address feedback
chris-oo Apr 2, 2026
1eaa285
flowey: replace vmm-tests-run meta-command with proper pipeline
chris-oo Apr 2, 2026
1fa82ef
fixup: inline discovery, fix WSL assumption, add serde_json dep
chris-oo Apr 2, 2026
5f953fc
flowey: remove checkin-gates for artifact mapping
chris-oo Apr 8, 2026
0eee2db
flowey: remove more unneeded pipelines
chris-oo Apr 8, 2026
95f1a2d
fixup: remove useless plans
chris-oo Apr 8, 2026
822877f
flowey: fixup vmm-tests-run, remove old unneeded flags and code
chris-oo Apr 8, 2026
bbb2767
flowey: add comment on artifct build mapping
chris-oo Apr 8, 2026
399d6ab
flowey: remove unused pipeline for artifact discovery
chris-oo Apr 9, 2026
2d88075
flowey: move auto_install to cfg
chris-oo Apr 9, 2026
c801ef2
flowey: fix build-igvm
chris-oo Apr 9, 2026
7c3444b
flowey: remove pipette builds on vhds, petri tells us already
chris-oo Apr 9, 2026
d805720
flowey: explicit config not default
chris-oo Apr 9, 2026
fd318ca
flowey: remove stale comment
chris-oo Apr 9, 2026
c8cf21a
petri: clarify why tests via stdin, btreeset only
chris-oo Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ Run tests with cargo-nextest in the specific packages you are modifying:
cargo nextest run -p <package-name>
```

For VMM test validation during development, use `cargo xflowey vmm-tests-run`:
```bash
# Run a specific test
cargo xflowey vmm-tests-run --filter "test(my_test_name)" --dir <output-dir>
```
This automatically discovers artifacts, builds dependencies, and runs tests.
See `Guide/src/dev_guide/tests/vmm.md` for details.

- **Unit tests** — spread throughout crates in `#[cfg(test)]` blocks.
Should be fast, isolated, and not require root/administrator access.
Add `use test_with_tracing::test;` in test modules so that `tracing`
Expand Down
3 changes: 3 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2069,6 +2069,7 @@ dependencies = [
"flowey_lib_hvlite",
"log",
"serde",
"serde_json",
"target-lexicon",
"vmm_test_images",
]
Expand All @@ -2095,10 +2096,12 @@ dependencies = [
name = "flowey_lib_hvlite"
version = "0.0.0"
dependencies = [
"anyhow",
"crossterm",
"flowey",
"flowey_lib_common",
"igvmfilegen_config",
"log",
"powershell_builder",
"serde",
"serde_json",
Expand Down
1 change: 1 addition & 0 deletions Guide/src/dev_guide/dev_tools/xflowey.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Some particularly notable pipelines:

- `cargo xflowey build-igvm` - primarily dev-tool used to build OpenHCL IGVM files locally
- `cargo xflowey restore-packages` - restores external packages needed to compile and run OpenVMM / OpenHCL
- `cargo xflowey vmm-tests-run` - build and run VMM tests with automatic artifact discovery. Use `--filter "test(name)"` to run specific tests

## `xflowey` vs `xtask`

Expand Down
54 changes: 37 additions & 17 deletions Guide/src/dev_guide/tests/vmm.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,46 @@ locally, set the following environment variable: `PETRI_REPORT_UNSTABLE_FAIL=1`

## Running VMM Tests (Flowey)

The easiest way to run the VMM tests locally is using the
`cargo xflowey vmm-tests` command. To see the most up-to-date options, run:
`cargo xflowey vmm-tests --help`. When running Hyper-V tests, you will need
to use an administrator terminal window (this works even if you are running
from WSL2). When running Windows tests, the output dir should be on the
Windows file system. For example, from WSL2:
The easiest way to run VMM tests locally is `cargo xflowey vmm-tests-run`. It
automatically discovers required artifacts, builds dependencies, and runs your
tests in a single command.

To run a **specific test** (or set of tests), use `--filter` with a
[nextest filter](https://nexte.st/docs/filtersets/) expression:

```bash
cargo xflowey vmm-tests --target windows-x64 --dir /mnt/e/vmm_tests
cargo xflowey vmm-tests-run --filter "test(my_test_name)" --dir /tmp/vmm-tests-run
```

This command will build or download all the test dependencies and copy them
to a self-contained folder that can be copied to another system for testing.
The folder will contain scripts for installing dependencies
(install_deps.ps1 on Windows) and running the tests (run.ps1 on Windows).
You can either specify a list of flags to disable certain tests and avoid
building/downloading some dependencies, or you can specify a custom
[nextest filter](https://nexte.st/docs/filtersets/) and list of artifacts.
In this case, all possible dependencies will be obtained since deriving them
from a test filter is not yet supported.
### Targeting a Platform

By default, `vmm-tests-run` builds for the current host. Use `--target` to
build for a different platform. The supported targets are:

| Target | Description |
|--------|-------------|
| `windows-x64` | Windows x86_64 (Hyper-V / WHP) |
| `windows-aarch64` | Windows ARM64 (Hyper-V / WHP) |
| `linux-x64` | Linux x86_64 |

**Cross-compiling for Windows from WSL2** is fully supported, you can build
and run Windows VMM tests directly from your WSL2 shell. This requires the
cross-compilation environment to be set up first.

Then target Windows as usual. The output directory **must** be on the Windows
filesystem (e.g., `/mnt/d/...`):

```bash
cargo xflowey vmm-tests-run --target windows-x64 --dir /mnt/d/vmm_tests
```

For full cross-compilation setup instructions, see
[Cross Compiling for Windows](../getting_started/cross_compile.md).

When running Hyper-V tests, your user account must be a member of the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll probably answer myself as I read on, but: does --install-missing-deps carry into this context? When you specify that (the first time) you'll need to be in the Administrators group running elevated. That should add you to this group, so you don't need to run non-elevated again.

Hyper-V Administrators group.

To see all available options: `cargo xflowey vmm-tests-run --help`.

## Running VMM Tests (Manual)

Expand Down Expand Up @@ -133,7 +153,7 @@ which provide detailed instructions on how to build / acquire the missing
artifact. Some dependencies can only be built on Linux (OpenHCL and Linux
pipette, for example). If you are building on Linux and want to run Windows
guest tests, pipette will need to be
[cross compiled for Windows](#linux-cross-compiling-pipetteexe).
[cross compiled for Windows](#linux-cross-compiling-pipetteexe).

```admonish warning
`cargo nextest run` won't rebuild any of your changes. Make sure you `cargo build`
Expand Down
4 changes: 2 additions & 2 deletions Guide/src/user_guide/openhcl/run/hyperv.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Use the `-GuestStateIsolationType OpenHCL` parameter to `New-VM`. The following

```powershell
# Names, directories, etc.
# cargo xflowey will do some heavy lifting for you. You can run `cargo xflowey vmm-tests --build-only --dir /mnt/q/win-vmm-tests ...` from your WSL to get images, compiled OpenHCL, etc. See [cross-compile](../../../dev_guide/getting_started/cross_compile.md) and [vmm-test](../../../dev_guide/tests/vmm.md) docs for additional info.
# cargo xflowey will do some heavy lifting for you. You can run `cargo xflowey vmm-tests-run --build-only --dir /mnt/q/win-vmm-tests ...` from your WSL to get images, compiled OpenHCL, etc. See [cross-compile](../../../dev_guide/getting_started/cross_compile.md) and [vmm-test](../../../dev_guide/tests/vmm.md) docs for additional info.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this correct?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(I guess it is). Feel free to ignore my bikeshedding, but why are you adding four more characters to what I need to type or copy as part of my hot loop, and breaking muscle memory? :)

$repoDir = "home\<your-wsl-username-for-example>\openvmm" # for prereqs below, the path relative to the root of your WSL file system where you have cloned the openvmm repo

$VmName = "OpenHCLTestVM"
Expand Down Expand Up @@ -144,7 +144,7 @@ While these steps guide you to create a second SCSI controller, your generation

```powershell
# Names, directories, etc.
# cargo xflowey will do some heavy lifting for you. You can run `cargo xflowey vmm-tests --build-only --dir /mnt/q/win-vmm-tests ...` from your WSL to get images, compiled OpenHCL, etc. See [cross-compile](../../../dev_guide/getting_started/cross_compile.md) and [vmm-test](../../../dev_guide/tests/vmm.md) docs for additional info.
# cargo xflowey will do some heavy lifting for you. You can run `cargo xflowey vmm-tests-run --build-only --dir /mnt/q/win-vmm-tests ...` from your WSL to get images, compiled OpenHCL, etc. See [cross-compile](../../../dev_guide/getting_started/cross_compile.md) and [vmm-test](../../../dev_guide/tests/vmm.md) docs for additional info.
$repoDir = "home\<your-wsl-username-for-example>\openvmm" # for prereqs below, the path relative to the root of your WSL file system where you have cloned the openvmm repo

$VmName = "OpenHCLTestVM"
Expand Down
6 changes: 3 additions & 3 deletions Guide/src/user_guide/openvmm/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If you ran `cargo xflowey restore-packages`, the firmware is at:
.packages/hyperv.uefi.mscoreuefi.AARCH64.RELEASE/MsvmAARCH64/RELEASE_VS2022/FV/MSVM.fd # aarch64
```

If you used `cargo xflowey vmm-tests --build-only --dir <out>`, the firmware
If you used `cargo xflowey vmm-tests-run --build-only --dir <out>`, the firmware
is copied into that output directory under the same relative path.

Alternatively, set the environment variable so you don't need the flag each time:
Expand Down Expand Up @@ -154,11 +154,11 @@ This example will boot OpenHCL in Linux direct mode, running a minimal shell
inside VTL2. This is the same configuration used by the `openhcl_linux_direct_x64`
integration tests.

First, build the test artifacts from Linux or WSL using `vmm-tests --build-only`.
First, build the test artifacts from Linux or WSL using `vmm-tests-run --build-only`.
The IGVM must be built on Linux:

```shell
cargo xflowey vmm-tests --build-only --dir <out> --target windows-x64
cargo xflowey vmm-tests-run --build-only --dir <out> --target windows-x64
```

```admonish tip
Expand Down
1 change: 1 addition & 0 deletions flowey/flowey_hvlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ anyhow.workspace = true
clap = { workspace = true, features = ["derive"] }
log.workspace = true
serde = { workspace = true, features = ["std"] }
serde_json.workspace = true
target-lexicon = { workspace = true, features = ["serde_support"] }

[lints]
Expand Down
10 changes: 5 additions & 5 deletions flowey/flowey_hvlite/src/pipelines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

use flowey::pipeline::prelude::*;
use restore_packages::RestorePackagesCli;
use vmm_tests::VmmTestsCli;
use vmm_tests_run::VmmTestsRunCli;

pub mod build_docs;
pub mod build_igvm;
pub mod build_reproducible;
pub mod checkin_gates;
pub mod custom_vmfirmwareigvm_dll;
pub mod restore_packages;
pub mod vmm_tests;
pub mod vmm_tests_run;

#[derive(clap::Subcommand)]
#[expect(clippy::large_enum_variant)]
Expand All @@ -34,8 +34,8 @@ pub enum OpenvmmPipelines {
/// Install tools needed to build OpenVMM
RestorePackages(RestorePackagesCli),

/// Build and run VMM tests
VmmTests(VmmTestsCli),
/// Build and run VMM tests with automatic artifact discovery
VmmTestsRun(VmmTestsRunCli),
}

#[derive(clap::Subcommand)]
Expand Down Expand Up @@ -63,7 +63,7 @@ impl IntoPipeline for OpenvmmPipelines {
OpenvmmPipelinesCi::BuildDocs(cmd) => cmd.into_pipeline(pipeline_hint),
},
OpenvmmPipelines::RestorePackages(cmd) => cmd.into_pipeline(pipeline_hint),
OpenvmmPipelines::VmmTests(cmd) => cmd.into_pipeline(pipeline_hint),
OpenvmmPipelines::VmmTestsRun(cmd) => cmd.into_pipeline(pipeline_hint),
}
}
}
Loading
Loading