test: add LCOWV2 feature flag and v2 LCOW test surface#2747
Open
shreyanshjain7174 wants to merge 2 commits into
Open
test: add LCOWV2 feature flag and v2 LCOW test surface#2747shreyanshjain7174 wants to merge 2 commits into
shreyanshjain7174 wants to merge 2 commits into
Conversation
Introduce a `-feature LCOWV2` gate across the functional and cri-containerd test suites so the v2 LCOW controller can be exercised end-to-end without disturbing the existing v1 LCOW pipeline. Functional suite: * LCOWV2 implies LCOW in TestMain so featureLCOW-gated tests are reachable, then defaultLCOWOptions calls requireV1Only to short- circuit every v1 path cleanly. Net effect: only TestLCOW_V2_* runs. * Add helpers_v2_test.go and lcow_v2_test.go covering the v2 surface via internal/builder/vm/lcow + the v2 controller in-process. * Export LCOWBootFilesPath from test/pkg/uvm so v2 tests can resolve boot files without going through v1 *uvm.OptionsLCOW. cri-containerd suite: * Mirror the LCOWV2-implies-LCOW pattern; thread RuntimeHandler onto the CRI ImageSpec when pulling LCOW images so containerd selects the windows-lcow snapshotter and linux/amd64 platform (the sandbox- platform label alone is not honored by containerd >=2.0). * Add lcow_v2_test.go and the runhcs-lcow-v2 runtime handler constant. Flag plumbing: * Add IncludesExplicit and Include to IncludeExcludeStringSet so test TestMain hooks can implement feature implications safely after flag.Parse without breaking default-when-unset semantics. CI: * New `Build and run functional testing binary (LCOWV2)` step that invokes functional.test.exe -feature=LCOWV2. continue-on-error while the v2 surface is being grown. CRI v2 testing is intentionally deferred to a follow-up alongside the integration-tests v2 setup. * Build and upload containerd-shim-lcow-v2.exe as a test artifact. Signed-off-by: Shreyansh Sancheti <[email protected]>
c90f032 to
b034f3f
Compare
v2.1.0 fails to typecheck cross-module imports from test/ that resolve back into the parent module via a replace directive, producing: could not import github.com/Microsoft/hcsshim/internal/... (-: build constraints exclude all Go files in ...) This only affects the (windows, test) lint matrix entry; the same imports typecheck cleanly under (windows, "") and locally with v2.11.x. v2.5+ resolves this. Signed-off-by: Shreyansh Sancheti <[email protected]>
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.
What
Adds an opt-in
-feature LCOWV2gate across the functional and cri-containerd test suites so the in-progress v2 LCOW controller (internal/controller/vm+internal/builder/vm/lcow) can be exercised end-to-end without disturbing the existing v1 LCOW pipeline.Why
The v2 controller landed across recent PRs (#2627, #2629, the VM SCSI/VPMem controllers, etc.) but lacked a dedicated functional surface. Existing LCOW tests are tightly coupled to v1
*uvm.OptionsLCOWand calltestuvm.CreateLCOW/CreateAndStartLCOWFromOpts— they cannot drive the v2 controller without refactoring every test. A feature flag lets us:TestLCOW_V2_*;continue-on-error: truefor now).Changes
Functional suite (
test/functional)LCOWV2impliesLCOWinTestMainsofeatureLCOW-gated tests are reachable; thendefaultLCOWOptionscallsrequireV1Onlyand every v1 path short-circuits cleanly. Net effect under-feature LCOWV2: only the newTestLCOW_V2_*tests actually run.helpers_v2_test.goandlcow_v2_test.gocovering the v2 surface viainternal/builder/vm/lcow+ the v2 controller in-process.LCOWBootFilesPathfromtest/pkg/uvmso v2 tests can resolve boot files without going through v1*uvm.OptionsLCOW.cri-containerd suite (
test/cri-containerd)TestMain.RuntimeHandleronto the CRIImageSpecwhen pulling LCOW images so containerd selects thewindows-lcowsnapshotter andlinux/amd64platform (thesandbox-platformlabel alone is not honored by containerd ≥ 2.0).runhcs-lcow-v2runtime handler constant andlcow_v2_test.goscaffold.Flag plumbing (
test/pkg/flag)IncludesExplicitandIncludeonIncludeExcludeStringSetso testTestMainhooks can implement feature implications safely afterflag.Parsewithout breaking default-when-unset semantics.CI (
.github/workflows/ci.yml)Build and run functional testing binary (LCOWV2)step that invokesfunctional.test.exe -feature=LCOWV2 -exclude=LCOWIntegrity. Markedcontinue-on-error: truewhile the v2 surface is being grown so a v2-specific failure does not block the v1 pipeline.containerd-shim-lcow-v2.exeas a test artifact.Out of scope (follow-up)
Test_V2_LCOW_*intest/cri-containerd) requires a CI step that starts containerd withsnapshotter = "windows-lcow"set on both therunhcs-lcowANDrunhcs-lcow-v2runtime blocks. That step is deferred to a follow-up PR alongside the integration-tests v2 setup.TestLCOW_V2_*surface beyond the initial scaffold.Validation
functional.test.exe -feature=LCOWV2on a Windows host.-feature LCOWinvocations route to the same code paths as before.platforms.DefaultSpec()inimage_pull.goand ignores theruntime_platformsmapping; gating those tests on CI is intentionally deferred.DCO
Signed-off-by in commit.