Repository navigation
refactor(tmt): extract component test helper package - #418
Merged
Nan Liu (liunan-ms) merged 1 commit intoOct 29, 2026
Merged
Conversation
Move the existing component TMT options, configuration and source resolution, preflight, setup, native invocation, plugin and tests into internal/tmt. Keep command wiring and command-level tests in component, and relocate the unchanged runtime constraints together with their Dependabot and E2E consumers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The TMT runner extraction has no active review issues.
No open issues 🎉
What changed in this PR
Extracts component TMT execution into internal/tmt, continuing the build/test refactor after the image-builder and pytest extractions. The command retains CLI registration and flags while calling the extracted runner directly, preserving existing behavior.
Changes:
- Moves TMT options, validation, environment setup, execution, and the unchanged testcloud plugin into the helper package.
- Relocates implementation tests while retaining four command-level tests at the CLI boundary.
- Moves dependency pins unchanged and updates Dependabot, the virtual E2E consumer, and developer documentation.
| File | Description |
|---|---|
scenario/tmt_virtual_e2e_test.go |
Uses the relocated TMT requirements file. |
internal/tmt/requirements.txt |
Holds the unchanged TMT and testcloud pins. |
internal/tmt/component.go |
Owns the extracted component TMT runner and supporting logic. |
internal/tmt/component_internal_test.go |
Relocates implementation tests into the TMT package. |
internal/app/azldev/cmds/component/test.go |
Retains CLI wiring and delegates execution directly to TMT. |
internal/app/azldev/cmds/component/test_test.go |
Retains command registration and validation coverage. |
docs/developer/how-to/testing.md |
Updates the dependency path and removes stale version wording. |
.github/dependabot.yml |
Tracks TMT dependencies at their new location. |
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 component TMT integration into
internal/tmt: options, component/test resolution, configuration decoding, preflight, source preparation, venv setup, plan/hardware handling, candidate RPM insertion, native invocation, plugin, and implementation tests.The component command retains registration/flags and calls
tmt.RunComponentTestsdirectly. Its four existing command-level cases remain at the command boundary; there are no forwarding wrappers or compatibility aliases.Move the unchanged requirements file to
internal/tmt/requirements.txtand update Dependabot, the existing virtual E2E consumer, and developer documentation to follow it. Pins remaintmt==1.79.0andtestcloud==0.12.0; the embedded testcloud plugin is byte-identical.This is the fourth extraction in the planned build/test refactor, following #415 and #416. It is independent of the parallel LISA extraction. Existing VM/host modes, selection/failure policy, source/from-spec behavior, native plan steps, paths, diagnostics, guest bootstrap, and permission workarounds are preserved. Runtime fixes, shared execution contracts, new artifact policies, and new strategies remain separate work.
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 plugin was moved unchanged and the requiredmage allpipeline passed independently. Native E2E tests were not run; the existing TMT E2E quarantine remains intact.