Skip to content

Cover ReportGenerationService's report assembly #7380

Description

@aglinxinyuan

Task Summary

ReportGenerationService has no spec. It assembles the downloadable workflow report — the workflow snapshot, one block per operator, and an AI-written summary — and every branch that decides what a given operator contributes to that report is unexercised.

retrieveOperatorInfoReport picks one of four renderings per operator, and the choice depends on which result service the operator has:

Operator has Report shows
a paginated result service, page non-empty an HTML table of the first 10 rows
a paginated result service, page empty "No results found for operator"
a plain result service with a snapshot the last snapshot's html-content, resized to fit
a plain result service, no snapshot "No data found for operator"
neither "No results found for operator"

Worth real assertions rather than a smoke test, because the failure mode is a silently wrong report rather than an exception: showing the first visualization snapshot instead of the latest, or dropping a row whose cell is null.

Also worth covering: the two prompt builders (generateComment asks for at least 80 words, generateSummaryComment for at least 150 — near-identical methods where a copy-paste would go unnoticed), and generateReportAsHtml, which names the download after the workflow and revokes its object URL.

Two notes for whoever writes this:

  • jsdom's Blob has no text(), so the generated document has to be read back through a FileReader.
  • Build the anchor element before stubbing document.createElement, or the stub intercepts its own creation.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions