Skip to content

Scenario HTML report never records pass/fail status #1026

Description

@shreyaskommuri

Scenario HTML report never records pass/fail status

Describe the Bug

StatusReporter.generate_scenario_report() (src/cloudai/reporter.py) writes
the persistent <scenario>.html artifact from ReportItem objects, but
ReportItem only carries name, description, logs_path, and nodes,
there is no status field:

@dataclass
class ReportItem:
    """Enhanced report item for Slurm systems with node information."""

    name: str
    description: str
    logs_path: Optional[str] = None
    nodes: Optional[str] = None

general-report.jinja2's "Results" column reflects exactly that, it only
ever renders a logs link or "no logs", never a pass/fail state:

{% if item.logs_path %}
    <td><a href="{{ item.logs_path }}">logs</a></td>
{% else %}
    <td>no logs</td>
{% endif %}

The real pass/fail computation already exists, StatusReporter.print_summary()
calls tr.test.was_run_successful(tr) per test run and builds a rich table
with PASSED/FAILED, but that table is only captured to the log stream
(console.capture()), never written to disk or threaded into ReportItem/
the HTML template. So the terminal output shows accurate status, but the
saved HTML report, the artifact someone would actually keep, share, or open
later, does not.

Steps to Reproduce

Version/context: local checkout of NVIDIA/cloudai main, commit d50dfc5b.

Run the bundled Sleep scenario for real (not dry-run):

cloudai run \
  --system-config conf/common/system/standalone_system.toml \
  --tests-dir conf/common/test \
  --test-scenario conf/common/test_scenario/sleep.toml

Terminal output correctly shows all test cases PASSED via the Scenario results table. Open the generated <results>/sleep-scenario.html in that
same run's output directory:

grep -i "passed\|failed" <results-dir>/sleep-scenario.html

No matches. The saved report has a "Results" column with only a logs link,
nothing indicating whether the test passed or failed.

Expected Behavior

The persisted <scenario>.html report should show the same PASSED/FAILED
status already computed for the terminal summary, not just a logs link. A
reviewer opening the saved report later, without having seen the original
terminal output, currently cannot tell whether any test case actually
passed.

Additional Context

Found while doing real (non-dry-run) validation of CloudAI through a small
wrapper project, CloudAI Autotune.
Happy to open a small PR: add a status/error_message field to
ReportItem, populate it in ReportItem.from_test_runs via the same
was_run_successful(tr) call print_summary already makes, and render it
in general-report.jinja2's Results column alongside the existing logs
link. Wanted to check the shape is right before writing it.

AI was used for context and guidance while investigating and drafting this
report.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions