Skip to content

fix(html-reporter): use selected run for TraceLink instead of first run#41288

Open
triemerge wants to merge 1 commit into
microsoft:mainfrom
triemerge:fix/trace-link-selected-run
Open

fix(html-reporter): use selected run for TraceLink instead of first run#41288
triemerge wants to merge 1 commit into
microsoft:mainfrom
triemerge:fix/trace-link-selected-run

Conversation

@triemerge

Copy link
Copy Markdown
Contributor

Rationale

The TestCaseView component already tracks which run tab the user has selected via selectedResultIndex, but this value was never forwarded to TraceLink. The fix adds an optional run prop so the component can scope its trace lookup to the active result.

Fixes #41281

Changes

  • add optional run prop to TraceLink; when set, only check test.results[run] for trace attachments
  • pass selectedResultIndex as run to TraceLink

Callers that don't pass run (e.g. the file list view in testFileView.tsx) keep the existing first-result behavior, which is the correct default there since there is no run selection in that context.

Verification

  • ran a flaky test with --retries=1 --trace=on, confirmed that switching between Run and Retry #1 tabs produces different trace URLs in the "View Trace" link

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.

[Bug]: HTML reporter TraceLink shows trace from first run instead of selected run

1 participant