Skip to content

feat(component): report TMT results and diagnostic logs - #395

Closed
Daniel McIlvaney (dmcilvaney) wants to merge 2 commits into
microsoft:mainfrom
dmcilvaney:damcilva/tmt_json_output
Closed

Daniel McIlvaney (dmcilvaney) wants to merge 2 commits into
microsoft:mainfrom
dmcilvaney:damcilva/tmt_json_output

Conversation

@dmcilvaney

Copy link
Copy Markdown
Contributor

Builds on top of #382

Add a zero-input virtual TMT harness with a generated Azure Linux image, test-only probe RPM, private session libvirt state, persistent diagnostics, and owned-resource cleanup. Keep the known-red regression compiled but skipped in the standard E2E suite, with mage e2eTMT as the explicit execution path until provisioning fixes land.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Emit versioned JSON manifests linking native JUnit reports, retained results, and diagnostic logs. Preserve partial evidence and report lifecycle failures independently of test verdicts.

Add unprivileged local-TMT E2E coverage for reporting, artifact relocation, and cancellation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 20, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Descendant-held output pipes can block cancellation and manifest emission, and CI skips the real reporting integration regression.

2 open issues
What changed in this PR

Adds structured TMT reporting to component testing, building on the quarantined virtual regression from #382.

Changes:

  • Retains versioned JSON manifests, JUnit reports, native results, and diagnostic logs.
  • Adds local reporting regressions and container support for virtual testing.
  • Documents reporting, retention, cancellation, and test workflows.
File Description
scenario/​tmt_virtual_helpers_test.go Validates external virtual-test inputs.
scenario/​tmt_virtual_helpers_scenario_test.go Tests input validation.
scenario/​tmt_virtual_e2e_test.go Adds quarantined virtual regression.
scenario/​tmt_local_e2e_test.go Validates reporting and retained artifacts.
scenario/​testdata/​tmt-virtual/​tests/​smoke/​test.sh Checks guest policy and installed RPM.
scenario/​testdata/​tmt-virtual/​tests/​smoke/​main.fmf Defines virtual smoke test.
scenario/​testdata/​tmt-virtual/​plans/​smoke.fmf Configures virtual provisioning.
scenario/​testdata/​tmt-virtual/​azldev.toml Configures probe component.
scenario/​testdata/​tmt-virtual/​azldev-tmt-probe.spec Supplies component metadata.
scenario/​testdata/​tmt-virtual/​.fmf/​version Declares virtual fixture root.
scenario/​testdata/​tmt-local/​tests.fmf Defines reporting outcome fixtures.
scenario/​testdata/​tmt-local/​run.sh Exercises reporting and cancellation.
scenario/​testdata/​tmt-local/​plans.fmf Defines lifecycle failure cases.
scenario/​testdata/​tmt-local/​.fmf/​version Declares local fixture root.
scenario/​internal/​containertest/​containers.go Adds device options and timeout logs.
scenario/​internal/​containertest/​containers_test.go Checks timeout output retention.
scenario/​internal/​containertest/​containers_internal_test.go Checks container options.
scenario/​internal/​cmdtest/​cmdtest.go Exposes container execution options.
scenario/​internal/​cmdtest/​cmdtest_test.go Tests option configuration.
scenario/​image_build_e2e_test.go Shares image-building fixture.
scenario/​docker/​tmt-probe.spec Packages probe executable.
scenario/​docker/​tmt-probe.sh Provides deterministic RPM probe.
scenario/​docker/​run-tmt-e2e.sh Runs virtual regression with diagnostics.
scenario/​docker/​Dockerfile.tmt Supplies TMT test container.
magefiles/​magescenario/​magescenario.go Adds focused TMT targets.
internal/​app/​azldev/​command.go Propagates JSON output failures.
internal/​app/​azldev/​command_test.go Tests failed and short writes.
internal/​app/​azldev/​cmds/​component/​tmtartifacts.go Collects and validates retained evidence.
internal/​app/​azldev/​cmds/​component/​tmt_junit.xml.j2 Defines JUnit outcome projection.
internal/​app/​azldev/​cmds/​component/​tmt_junit.py Exports persisted TMT results.
internal/​app/​azldev/​cmds/​component/​testreport.go Manages manifests and subprocess capture.
internal/​app/​azldev/​cmds/​component/​testreport_internal_test.go Tests reporting lifecycle and failures.
internal/​app/​azldev/​cmds/​component/​test.go Integrates reporting into component tests.
internal/​app/​azldev/​cmds/​component/​test_internal_test.go Updates execution expectations.
internal/​app/​azldev/​agentskill/​content/​build-component.md.tmpl Adds reporting and safety guidance.
docs/​user/​reference/​cli/​azldev_component.md Updates command summary.
docs/​user/​reference/​cli/​azldev_component_test.md Documents CLI reporting behavior.
docs/​user/​explanation/​tmt-tests.md Explains manifest and retention contracts.
docs/​developer/​how-to/​testing.md Documents focused regression workflows.

Review effort: Balanced

Comment on lines +263 to +265
command.Stderr = io.MultiWriter(log, os.Stderr)
if !captureOutput {
command.Stdout = io.MultiWriter(log, stdout)
Comment on lines +53 to +54
if testing.Short() || os.Getenv("TESTING_ENABLE_TMT_LOCAL_E2E") == "" {
t.Skip("opt in with 'mage e2e -target=tmt-local'")
@dmcilvaney

Copy link
Copy Markdown
Contributor Author

#396 supercedes this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants