Repository navigation
refactor(lisa): extract image test helper package - #417
Merged
Nan Liu (liunan-ms) merged 1 commit intoOct 29, 2026
Merged
Conversation
Move the existing LISA definition parsing, criteria, runbook, setup, invocation and tests into internal/lisa. Image commands call the helper directly; shared image-format inference and its tests move to a neutral utility without changing format priority or diagnostics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the LISA execution and shared image-format refactor.
No open issues 🎉
What changed in this PR
Continues the build/test refactor from #415 and #416 by extracting LISA execution from the image command package into internal/lisa, while preserving existing behavior.
Changes:
- Moves LISA parsing, runbook generation, setup, invocation, and helper tests into a dedicated package.
- Extracts shared image-format inference and ordering into
internal/utils/imageformat. - Updates command dispatch and adds in-memory coverage for LISA option forwarding and runbook cleanup.
| File | Description |
|---|---|
internal/utils/imageformat/imageformat.go |
Houses shared format constants, ordering, and inference. |
internal/utils/imageformat/imageformat_test.go |
Retains extracted format-helper tests. |
internal/lisa/runner.go |
Extracts LISA execution with dedicated options. |
internal/lisa/runner_internal_test.go |
Retains argument, format, and checkout-resolution tests. |
internal/lisa/runbook.go |
Moves runbook generation into LISA ownership. |
internal/lisa/runbook_internal_test.go |
Moves runbook tests alongside implementation. |
internal/lisa/criteria.go |
Moves criteria parsing into LISA ownership. |
internal/lisa/criteria_internal_test.go |
Moves criteria tests alongside implementation. |
internal/app/azldev/cmds/image/test.go |
Calls LISA and shared format helpers directly. |
internal/app/azldev/cmds/image/test_test.go |
Adds LISA dispatch and cleanup coverage. |
internal/app/azldev/cmds/image/test_internal_test.go |
Relocates LISA-specific tests to the new package. |
internal/app/azldev/cmds/image/boot.go |
Uses shared helpers while retaining boot-specific validation. |
internal/app/azldev/cmds/image/boot_test.go |
Relocates shared format tests to the utility package. |
Review effort: Balanced
reuben olinsky (reubeno)
marked this pull request as ready for review
October 29, 2026 20:25
Daniel McIlvaney (dmcilvaney)
approved these changes
Oct 29, 2026
Nan Liu (liunan-ms)
approved these changes
Oct 29, 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.
Summary
Extract the existing LISA integration into
internal/lisa: definition/source parsing, criteria, runbook generation, framework/venv setup, invocation, and helper tests. The image command retains selection and dispatch and callslisa.RunTestDefinitiondirectly, without forwarding wrappers.Move the existing shared image-format inference and format ordering from the boot command into
utils/imageformat, with its tests. Boot and LISA use that neutral helper rather than making LISA depend on command-package code.This is the third extraction in the planned build/test refactor, following #415 and #416. It is independent of the parallel TMT extraction. Existing qcow2-only behavior, arguments, diagnostics, work paths, cached checkouts, venv reuse, key handling, runbook contents, and cleanup remain unchanged. No new framework capabilities, artifact policies, runtime isolation, or result semantics are introduced.
Validation
mage all— passed, including code generation/build, unit tests, default quality checks, scenarios, and CLI/schema generation.git diff --check upstream/main...HEAD— passed.0.0.0-develversion label.mage fix allcompleted Go formatting/linting with zero issues, then stopped at optional Python autofixing becauseruffis unavailable. No Python source changed; the requiredmage allpipeline passed independently. Native E2E tests were not run.