feat(microvmtest): add untagged microVM test gate package - #503
Open
rigel-mintaka wants to merge 1 commit into
Open
feat(microvmtest): add untagged microVM test gate package#503rigel-mintaka wants to merge 1 commit into
rigel-mintaka wants to merge 1 commit into
Conversation
|
Compass engineering docs preview: https://compass-runner-rig-2520-micr.compass-eng-docs.pages.dev Deployed from |
Add `go/internal/microvmtest`, the shared runtime gate the two-tier tag rule requires. `Require(t)` probes whether `/dev/kvm` is openable by the current uid, skips with a named reason when it is not, and hard-fails when `COMPASS_REQUIRE_MICROVM` is set — the pgtest `RequireDSN`/`COMPASS_REQUIRE_LIVE` posture, so a KVM-less CI leg reds rather than silently passing. The pure `decideKVMSource` decision function is split from the `*testing.T` dispatch (mirroring `decideDSNSource`) so the policy is unit-testable without real hardware; the `/dev/kvm` open probe is injected as a bool, kept out of the pure function. Unlike pgtest, the package's non-test files compile UNTAGGED so the moon battery type-checks the gate everywhere. The `//go:build microvm && unix` tag lives in the consuming V2a+ integration tests, which call `microvmtest.Require(t)` first; this package is the untagged shared gate they import. Refs RIG-2520 Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
compass-runner/rig-2520-microvmtest-gate
branch
from
August 23, 2026 00:17
5c963d8 to
3855996
Compare
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.
Add
go/internal/microvmtest, the shared runtime gate the two-tier tag rule requires.Require(t)probes whether/dev/kvmis openable by the current uid, skips with a named reason when it is not, and hard-fails whenCOMPASS_REQUIRE_MICROVMis set — the pgtestRequireDSN/COMPASS_REQUIRE_LIVEposture, so a KVM-less CI leg reds rather than silently passing.The pure
decideKVMSourcedecision function is split from the*testing.Tdispatch (mirroringdecideDSNSource) so the policy is unit-testable without real hardware; the/dev/kvmopen probe is injected as a bool, kept out of the pure function.Unlike pgtest, the package's non-test files compile UNTAGGED so the moon battery type-checks the gate everywhere. The
//go:build microvm && unixtag lives in the consuming V2a+ integration tests, which callmicrovmtest.Require(t)first; this package is the untagged shared gate they import.Refs RIG-2520
Co-authored-by: Matt Wilkinson matt@rigel.build