Repository navigation
tests: add the runtime adapter and run its checks in CI - #626
Merged
Enrique Saurez (esaurez) merged 1 commit intoOct 20, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The scoped scaffolding, contract tests, and CI integration have no identified blocking issues.
No open issues 🎉
What changed in this PR
Adds an independent runtime adapter to verify that external consumers can build against nvx-rs through its public API, establishing the C0 foundation for later runtime scenarios.
Changes:
- Adds protocol-only, host-only, and static musl guest-only configurations with contract tests.
- Integrates adapter checks, change classification, and placeholder scenario hooks into CI.
- Documents the adapter and contributor validation requirements.
| File | Description |
|---|---|
tests/runtime-adapter/tests/independent_build.rs |
Checks build independence, feature isolation, binaries, and static linkage. |
tests/runtime-adapter/src/lib.rs |
Reports public runtime contract versions. |
tests/runtime-adapter/src/bin/runtime-adapter-host.rs |
Adds the host skeleton. |
tests/runtime-adapter/src/bin/runtime-adapter-guest.rs |
Adds the guest skeleton. |
tests/runtime-adapter/README.md |
Documents configurations, tests, and CI integration. |
tests/runtime-adapter/Cargo.toml |
Defines the standalone adapter and feature configurations. |
tests/runtime-adapter/Cargo.lock |
Pins independent dependency resolution. |
scripts/test_nvx_tools.py |
Tests adapter checks and CI routing. |
scripts/nvx_tools/ci.py |
Classifies adapter changes as microVM test inputs. |
doc/project-structure.md |
Adds the adapter to the repository map. |
doc/contribute.md |
Documents adapter validation and test placement. |
doc/ci.md |
Explains adapter checks and scenario hooks. |
.gitignore |
Excludes adapter build output. |
.github/workflows/run-nvx-microvm-tests.yml |
Adds backend-specific hooks for future scenarios. |
.github/copilot-instructions.md |
Includes adapter checks in contributor guidance. |
.github/actions/check-nvx-rs/action.yml |
Validates all three adapter configurations. |
Review effort: Balanced
Enrique Saurez (esaurez)
marked this pull request as ready for review
October 20, 2026 06:40
Add tests/runtime-adapter, an independent adapter that builds on nvx-rs the way an adapter outside the repository does: a path dependency with default features off, a lockfile of its own, the public API only, and the minimum Rust version of nvx-rs. Its protocol-only, host-only, and guest-only configurations each select one side of nvx-rs, and the guest one builds a static x86_64-unknown-linux-musl executable. Its host and guest binaries are skeletons that later steps fill. Its tests check consumer-contract scenario C0: the dependency tree of each configuration, which cargo tree resolves from the lockfile; that the guest build pulls in neither Tokio nor a dependency that only the host side of nvx-rs declares; that the binaries run; and that the guest binary is a static executable. check-nvx-rs checks each configuration with rustfmt, Clippy, the build, the tests, and the minimum Rust version. The microVM workflow gains a hook that runs the adapter's ignored tests on each backend, which later steps add, and the change classifier treats the adapter as a test input, so that a change to the adapter alone runs the microVM jobs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b901ceb9-fff0-4a76-9f55-a4b07d9c0633
Pedro Henrique Penna (ppenna)
force-pushed
the
esaurez/a1-test-adapter-ci-20261019
branch
from
October 20, 2026 14:44
7a19409 to
b85ae65
Compare
Pedro Henrique Penna (ppenna)
approved these changes
Oct 20, 2026
Enrique Saurez (esaurez)
deleted the
esaurez/a1-test-adapter-ci-20261019
branch
October 20, 2026 15:31
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
tests/runtime-adapter/, the in-repository test adapter of #535: an independent adapter that builds onnvx-rsthe way an adapter outside the repository does. From this PR on, NVX's own CI proves that such an adapter builds againstnvx-rsthrough its public API only, and a change to the adapter alone runs the microVM jobs. Later A1 steps (G6 and H5) fill it with real scenarios.What changed
The crate,
tests/runtime-adapter/:Cargo.lockand no parent workspace, a path dependency onnvx-rs(librarynvx) withdefault-features = false, the MSRV ofnvx-rs(rust-version = "1.89"), andunsafe_code = "forbid".--features host), and guest-only (--features guest --target x86_64-unknown-linux-musl).runtime-adapter-hostandruntime-adapter-guestare skeletons that print the contract they were built against: the control contract revision and the microVM ABI, NVXS, and NVXC versions, all from the public API.nvx-rs/Cargo.lock, so it resolves the same registry versions asnvx-rs, without the dev-dependencies ofnvx-rs.C0 as tests, in
tests/independent_build.rs, which every configuration runs:cargo locate-project --workspace), and declares the MSRV ofnvx-rs.cargo tree --lockedon the lockfile: protocol-only depends onnvx-rsalone, with no feature; host-only enableshostand notguest; guest-only, for musl, enables exactlyguest, pulls in notokioortokio-*crate, and none of the dependencies that the host side ofnvx-rsdeclares and its guest side doesn't. The tests read that set from the tree too: todayserde,serde_json, andsha2.PT_INTERP, noDT_NEEDED, and a non-executable stack. A synthetic-ELF test checks that the checker detects each of these.CI:
check-nvx-rsruns one step per configuration: rustfmt (once), Clippy with-D warnings,cargo build,cargo test, andcargo checkwith the MSRV toolchain. The guest-only step runs on Linux, where it adds the musl target to both toolchains.CI_TEST_INPUT_PATHSinscripts/nvx_tools/ci.pynow includestests/runtime-adapter/. It is an input of neither OpenVMM suite. A new test inscripts/test_nvx_tools.py, next to the existing classification cases, classifies adapter-only changes and checks throughrequired_ci_expected_resultsthat the pull request expects every microVM job and skips both OpenVMM suites. It fails without theci.pychange.run-nvx-microvm-tests.ymlgets a placeholder hook, "Run runtime adapter scenarios on Linux/Windows":cargo test --locked --features host -- --ignoredin the adapter, withNVX_HYPERVISORset to the backend, whichnvx::Hypervisor::from_env_or_defaultreads. The debug-kernel jobs skip it. The adapter has no ignored test yet, so the step only builds it; later steps add scenarios as ignored tests.doc/ci.md,doc/contribute.md,doc/project-structure.md,.github/copilot-instructions.md, and the adapter's README.Not in this PR:
nvx-rsfile changes. I left its README alone because the guest image cache keys hashnvx-rs/**, so a documentation-only edit there would rebuild every guest image.Part of #619. Refs #535, #620.
Validation
Started from
devat 4a6c3b6.Windows 11, x86_64-pc-windows-msvc, Rust 1.95.0 and 1.89:
python scripts\nvx.py verify.tests/runtime-adapter, protocol-only and host-only:cargo fmt --all --check,cargo clippy --locked --all-targets [--features host] -- -D warnings,cargo build --locked,cargo test --locked(6 and 7 tests pass), andcargo +1.89 check --locked --all-targets.nvx-rs,NVX_BUNDLE=skip cargo test --locked --all-featurespasses; nonvx-rsfile changed.scripts/check_markdown_links.py.test_setup_azureand are environmental: this host'sbashis the WSL launcher, which can't open theD:/temporary paths; CI's Windows runner uses Git Bash. This PR changes none of the files that they test.python scripts\nvx.py classify-ci-changeson an adapter-only file list: the pull request setsrun-tests=trueandrun-workloads=true, and both OpenVMM suites false. A push sets all four true.Linux, WSL Ubuntu on x86_64:
x86_64-unknown-linux-musl: Clippy, build, test (8 tests in guest-only), andcargo +1.89 check. The guest binary is static-pie, andnvx.py check-static-elfagrees.test_adversarial.pyhas one failure,test_contained_native_process_preserves_child_signal_status, which fails the same way on unmodifieddevunder WSL.nvx-rs/host, the default features ofnvx-rsturned on, a different declared MSRV, a guest binary built for glibc, and the classifier without theci.pychange.I ran no hypervisor: the hook has no scenario yet. Left to CI: the microVM jobs on KVM, MSHV, and WHP, which exercise the hook, and the
nvx-rsjobs on GitHub-hosted Linux and Windows, which run the adapter's checks.