Skip to content

bugfix: report correct run duration and version in report - #9743

Merged
sanish-bruno merged 2 commits into
usebruno:mainfrom
prateek-bruno:fix/runner-report
Nov 12, 2026
Merged

sanish-bruno merged 2 commits into
usebruno:mainfrom
prateek-bruno:fix/runner-report

Conversation

@prateek-bruno

@prateek-bruno prateek-bruno commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Internal Ref - BRU-4661

Problem

The CLI HTML report (--reporter-html) shows the version with a "usebruno" prefix, e.g. usebruno v1.16.0.

Fix

  • Version shows without the prefix, e.g. v1.16.0.
  • Total run duration is now computed from the run's start and completion times instead of by summing request durations. For a CLI run the value is effectively unchanged. Measuring it this way lets runs with overlapping iterations report the real time.

Screenshots

Before After
Screenshot 2026-11-03 at 5 36 12 PM Screenshot 2026-11-03 at 5 35 34 PM

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have tested these changes locally and confirmed they work as expected.
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.
  • I've run the claude code review skill locally.

Summary by CodeRabbit

  • New Features
    • HTML run reports now show the run’s start time, completion time, and total elapsed duration.
  • Bug Fixes
    • Elapsed duration reflects the time between run start and completion. If either timestamp is missing or invalid, or completion occurs before the start, the report displays “-”.
    • The version label in HTML reports now uses a consistent v prefix.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CLI now passes run start and completion timestamps to HTML report generation. The report embeds both timestamps and calculates total run duration from them. Invalid or negative durations display as -. The report version uses the v prefix without usebruno.

Changes

HTML report timing

Layer / File(s) Summary
Pass run timestamps to report generation
packages/bruno-cli/src/commands/run.js, packages/bruno-cli/src/reporters/html.js, packages/bruno-common/src/runner/reports/html/generate-report.ts, packages/bruno-cli/tests/reporters/*, packages/bruno-cli/tests/runner/report-metadata.spec.js
The CLI records the run start time and passes it with the completion time through report generation. The report version changes to the v-prefixed format. Tests cover timestamp and version forwarding, environment handling, and updated version fixtures.
Calculate dashboard run duration
packages/bruno-common/src/runner/reports/html/template.ts, packages/bruno-common/src/runner/reports/html/template.spec.ts
The dashboard calculates elapsed seconds from run start and completion timestamps. It displays - when a timestamp is missing or invalid, or when the completion time precedes the start. Tests check duration formatting and embedded report data.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: Minimal · up to 22028

The CLI HTML report now shows the version with a v prefix and calculates total run duration from the run's start and end times. The only production caller was updated to match the new signature, so no concrete merge-blocking risk remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies both primary changes: correcting the report duration and the report version.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 8 files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The run begins; its time is stored.
The report carries both ends forward.
Elapsed seconds fill the view.
Invalid dates show a dash in lieu.
A v now marks the version line.
The report’s timing stays in time.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2514bd2 and 2202800.

Files selected for processing: 1

  • packages/bruno-common/src/runner/reports/html/template.spec.ts
Files skipped from review as they are similar to previous changes: 1

  • packages/bruno-common/src/runner/reports/html/template.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@prateek-bruno
prateek-bruno marked this pull request as ready for review November 3, 2026 12:13
@prateek-bruno
prateek-bruno requested a review from a team November 3, 2026 12:13

@coderabbitai coderabbitai Bot 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.

Additional comments: 1
packages/bruno-common/src/runner/reports/html/template.ts-523-523: 1

523-523: Minor · Data Integrity & Integration · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Preserve duration for callers without a start time.

generateHtmlReport exports runStartTime as optional. Existing callers that omit it now see - instead of the previous duration derived from runDuration. The fixtures in packages/bruno-cli/tests/reporters/skip-body.spec.js Lines 62–70 use that input shape. (raw.githubusercontent.com)

Preserve the previous calculation as a fallback when the start time is absent, or update all affected producers to supply it.

As per coding guidelines: “Reconcile the whole flow, not the entry point.”

Source: Coding guidelines

Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 97bb5ee and 63b6525.

Files selected for processing: 8
  • packages/bruno-cli/src/commands/run.js
  • packages/bruno-cli/src/reporters/html.js
  • packages/bruno-cli/tests/reporters/html.spec.js
  • packages/bruno-cli/tests/reporters/skip-body.spec.js
  • packages/bruno-cli/tests/runner/report-metadata.spec.js
  • packages/bruno-common/src/runner/reports/html/generate-report.ts
  • packages/bruno-common/src/runner/reports/html/template.spec.ts
  • packages/bruno-common/src/runner/reports/html/template.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@prateek-bruno prateek-bruno changed the title bugfix: run duration and version were incorrect in cli bugfix: report correct run duration and version in report Nov 10, 2026
@sanish-bruno
sanish-bruno merged commit 3768039 into usebruno:main Nov 12, 2026
16 of 19 checks passed
aparna-bruno pushed a commit to aparna-bruno/bruno that referenced this pull request Nov 20, 2026
)

* fix(cli): drop usebruno prefix from report version, measure total run
duration from start and end

* fix: review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants