Skip to content

ROCMAI-763: split the e2e-report HTML and markdown renderers out of consolidated/mod.rs - #833

Merged
jussielo-amd merged 2 commits into
ROCm:mainfrom
jussielo-amd:refactor-e2e-report-renderers
Nov 2, 2026
Merged

jussielo-amd merged 2 commits into
ROCm:mainfrom
jussielo-amd:refactor-e2e-report-renderers

Conversation

@jussielo-amd

Copy link
Copy Markdown
Collaborator

Why

After the first half of the e2e-report split (the consolidated/ directory with its descriptor and sidecar modules), consolidated/mod.rs still held both report renderers, HTML and markdown, together with the model, the grid and the bundle. This change moves the two renderers into modules of their own, as pure moves. It also removes the production dependency of consolidated/mod.rs on command_coverage.rs that docs/architecture.md described as a back-edge: after it, the dependency runs one way, from markdown.rs to command_coverage.rs to consolidated. Completes ROCMAI-763; the two optional follow-up moves are tracked as ROCMAI-832.

What changes

Two commits, one per step, so the branch can be reviewed commit by commit:

  1. consolidated/html.rs takes RunMeta with its line method, generate_consolidated, expectation_grid_html, matrix_table, legend and platform_section, with the three HTML tests. Only expectation_grid_html is widened (pub(super)), so the cross-renderer tests that stay in mod.rs can call it.
  2. consolidated/markdown.rs takes consolidated_summary_markdown, expectation_grid_markdown, scenario_reference_markdown and the command_coverage_markdown import, with the 13 tests that assert on markdown output. Nothing is widened.

The four tests that assert that HTML and markdown agree over one bundle stay in mod.rs, next to the bundle. lib.rs re-exports RunMeta, generate_consolidated and consolidated_summary_markdown from the new modules, so the crate's public names are unchanged and xtask compiles untouched. html.rs and markdown.rs never call each other.

Besides the relocations, the commits make these edits: intra-doc links in the moved comments and in the parent's docs are rewritten to path-qualified links (super::load_platform_reports, html::generate_consolidated, markdown::consolidated_summary_markdown, written as reference-style links in markdown.rs to satisfy clippy::too_long_first_doc_paragraph); each new file has a licence header and a module doc, and the mod.rs module doc is reworded; test-module imports are rewired; and docs/architecture.md gets an entry per new file, with the mod.rs entry, the re-export sentence and the dependency sentence rewritten to match.

Verification

  • cargo fmt --check and cargo clippy -p e2e-report -p xtask --all-targets -- -D warnings are clean, and each commit builds.
  • The leaf-name test lists are identical before and after: 69 tests, none lost or duplicated; the moved modules' own tests pass (3 for html, 13 for markdown).
  • cargo xtask manifest --check and cargo xtask check-crate-edges pass.
  • The ticket's rustdoc command (-D rustdoc::broken_intra_doc_links -D rustdoc::private_intra_doc_links) exits non-zero on main too, because load_platform_reports links to the private load_reports; its output is the same before and after this change, so no new warning or error is added.
  • Not run locally: the full workspace tests, cargo test -p xtask, the tests/e2e-cucumber suite and the Windows lane.

Scope

This is an internal refactor with no user-observable change, so no end-to-end scenario is added; the unmodified tests/e2e-cucumber suite covers the unchanged behaviour. consolidated/mod.rs keeps a #[cfg(test)] import from command_coverage for one test that stays there, so the dependency is gone from production code only. Not part of this PR, and tracked as ROCMAI-832: moving command_coverage.rs under consolidated/, which reverses a recorded decision and needs its author's agreement, and the optional grid.rs split, which costs about fifteen widenings for little gain. Open PRs that edit the same files (#518, #241 and #284) will need rebasing onto the new layout.

Template checklist: not a bug fix, so there are no stale xfail rows to narrow; no new subcommand or subsystem; no user-facing message is added or changed.

Moves RunMeta, generate_consolidated, expectation_grid_html, matrix_table,
legend and platform_section out of consolidated/mod.rs into the new child
module consolidated/html.rs, together with the three tests that exercise only
them (generate_consolidated_renders_the_expectation_grid,
generate_consolidated_writes_html,
expectation_grid_html_legend_colors_every_red_glyph). The four cross-renderer
tests stay in mod.rs. As a child module it reads the private model types in
the parent, so the only widening is pub(super) on expectation_grid_html, for
those cross-renderer tests. lib.rs re-exports RunMeta and generate_consolidated
from consolidated::html; the crate's public names are unchanged.

Edits other than relocated lines, module and import wiring, and that
visibility change:
- the two links to load_platform_reports in generate_consolidated's doc comment
  became path links (super::load_platform_reports), as the target is not
  imported into html.rs
- the three links to generate_consolidated in the docs of PlatformReports,
  load_platform_reports and consolidated_summary_markdown became
  html::generate_consolidated
- one doc paragraph in generate_consolidated was re-wrapped after that link
  rewrite
- new module doc comment in html.rs, SPDX header on the new file, and a
  reworded module doc in mod.rs (it no longer holds the HTML generation)
- the tests module of mod.rs gained an import of the moved items, and the
  moved tests import test_support and the parent's loaders by path
- docs/architecture.md: new entry for html.rs, reworded mod.rs entry and
  lib.rs re-export sentence

Signed-off-by: Jussi Elo <jussi.elo@amd.com>
…rkdown

Moves consolidated_summary_markdown, expectation_grid_markdown and
scenario_reference_markdown, together with the command_coverage_markdown
import, out of consolidated/mod.rs into the new child module
consolidated/markdown.rs, and with them the 13 tests that assert on markdown
output through load_platform_reports and consolidated_summary_markdown. The
cross-renderer tests, the command-coverage tests and summary_status_reconciles_
xfail_as_pass stay in mod.rs. Production code in mod.rs no longer depends on
command_coverage.rs (the edge is now markdown.rs to command_coverage.rs to
mod.rs); only the remaining command-coverage tests in mod.rs still import from
it. As a child module, markdown.rs reads the private model types in the
parent, so nothing is widened. lib.rs re-exports consolidated_summary_markdown
from consolidated::markdown; the crate's public names are unchanged.

Edits other than relocated lines and module and import wiring (no visibility
change in this commit):
- in consolidated_summary_markdown's doc comment, the links to
  generate_consolidated and load_platform_reports became reference-style path
  links (super::html::generate_consolidated, super::load_platform_reports); the
  definitions sit at the end of the doc block so the first paragraph stays
  within clippy's length limit. These are doc links only, markdown.rs does not
  call html.rs
- the two links to consolidated_summary_markdown in the docs of PlatformReports
  and load_platform_reports became markdown::consolidated_summary_markdown
- new module doc comment in markdown.rs, SPDX header on the new file, and a
  reworded module doc in mod.rs (it no longer holds the markdown generation)
- the tests module of mod.rs gained an import of consolidated_summary_markdown,
  and the moved tests import test_support and load_platform_reports by path
- docs/architecture.md: new entry for markdown.rs, reworded mod.rs entry, the
  lib.rs re-export sentence, and the sentence about the dependency between
  command_coverage.rs and consolidated, which was no longer true: it now says
  the file-level chain is acyclic and that only the module as a whole still
  depends on command_coverage.rs

Signed-off-by: Jussi Elo <jussi.elo@amd.com>

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.

🟢 Approval recommended

No active review issues remain for the renderer-module split.

No open issues 🎉

What changed in this PR

Completes the e2e-report renderer split by moving HTML and markdown generation into dedicated modules, preserving report behavior and the crate’s public API.

Changes:

  • Relocates both renderers and their tests, keeping shared models and cross-renderer tests in consolidated/mod.rs.
  • Moves the production command-coverage dependency into the markdown renderer.
  • Updates re-exports, intra-doc links, and architecture documentation for the new layout.
File Description
docs/​architecture.md Documents renderer ownership and the revised dependency structure.
crates/​e2e-report/​src/​lib.rs Preserves public names through updated re-exports.
crates/​e2e-report/​src/​consolidated/​mod.rs Retains shared models, bundle construction, and cross-renderer tests.
crates/​e2e-report/​src/​consolidated/​markdown.rs Houses markdown rendering, command-coverage integration, and 13 relocated tests.
crates/​e2e-report/​src/​consolidated/​html.rs Houses HTML rendering, RunMeta, and three relocated tests.

Review effort: Balanced

@jussielo-amd
jussielo-amd marked this pull request as ready for review November 2, 2026 13:03
@jussielo-amd
jussielo-amd requested a review from a team as a code owner November 2, 2026 13:03

@juhovainio juhovainio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No blocking findings.

Verified

  • The html and markdown renderers moved out of consolidated/mod.rs as a mechanical move. Comparing removed and added lines, the only differences are licence headers, module docs, one pub(super) on expectation_grid_html, rewritten intra-doc links, test import rewiring and mod tests scaffolding.
  • 16 #[test] functions removed and 16 added (3 in html, 13 in markdown), so test count is preserved.
  • lib.rs re-exports match the API decided in the ticket.
  • Licence headers are present, docs are updated in the same change, and there are no internal references.

Non-blocking notes

  • The html and markdown moves were planned as separate PRs; here they are two commits in one PR. Still one logical change.
  • A #[cfg(test)] use crate::command_coverage remains in mod.rs because the command-coverage tests stay there. The PR body discloses and justifies this.

CI: no failures at review time. windows-build-and-test and the GPU E2E lanes were still pending, so please let those finish green before merging.

@jussielo-amd
jussielo-amd added this pull request to the merge queue Nov 2, 2026
Merged via the queue into ROCm:main with commit 5ba1a7c Nov 2, 2026
29 of 31 checks passed
@jussielo-amd
jussielo-amd deleted the refactor-e2e-report-renderers branch November 2, 2026 13:31
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.

3 participants