Skip to content

Show multi-step test spans in class timeline, align report ordering with execution, and correlate linked OTel activities#5847

Draft
Copilot wants to merge 9 commits intomainfrom
copilot/feature-multi-step-test-execution
Draft

Show multi-step test spans in class timeline, align report ordering with execution, and correlate linked OTel activities#5847
Copilot wants to merge 9 commits intomainfrom
copilot/feature-multi-step-test-execution

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

Multi-step DependsOn workflows were hard to follow in the HTML report because the class timeline excluded test-case spans, and the test list ordering could diverge from the span ordering. This updates the reporter to surface those per-step spans in the class timeline and present tests in execution order so BDD-style flows are easier to read.

This PR also fixes the missing OpenTelemetry activity correlation path for distributed flows that continue on a linked trace rather than the original test trace. Incoming OTLP spans that carry links to the test trace are now associated back to the owning test so they can appear in the report and correlate logs/output correctly.

  • Class timeline

    • Stop filtering out test-case spans from the class-level waterfall.
    • Keep the timeline readable by collapsing synthetic test body spans and re-parenting their children to the test-case span.
  • Execution ordering

    • Sort tests in each class by StartTime, then by name as a stable tie-breaker.
    • This keeps the visible test list aligned with the order shown in the timeline for chained DependsOn scenarios.
  • OTel linked-trace correlation

    • Register derived OTLP traces back to the owning test when incoming spans include links to the original test trace.
    • Allow the activity collector to ingest external spans that are known via TraceRegistry, even if their trace IDs were not seen by the in-process listener first.
    • This covers async/distributed workflows where downstream processing starts a new trace but preserves causality through OTEL span links.
  • Regression coverage

    • Add focused reporter tests for:
      • test ordering by execution start time
      • generated HTML containing the updated class timeline logic
    • Add focused OpenTelemetry tests for:
      • OTLP receiver ingestion of linked/derived traces
      • trace-to-test correlation for externally reported spans

Example of the kind of flow this makes visible in the class timeline:

[Test]
public Task SetupWiremock() => Task.CompletedTask;

[Test]
[DependsOn(nameof(SetupWiremock))]
public Task SendMessage() => Task.CompletedTask;

[Test]
[DependsOn(nameof(SendMessage))]
public Task VerifyWiremockWasCalled() => Task.CompletedTask;

With this change, those steps are rendered in the class timeline instead of being hidden behind suite-level spans only, and linked downstream OTel activities can now be attributed back to the triggering test.

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 7, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copilot AI and others added 2 commits May 7, 2026 11:20
Agent-Logs-Url: https://github.com/thomhurst/TUnit/sessions/48d47cff-3125-44ff-b19b-e1dfe712be9f

Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Agent-Logs-Url: https://github.com/thomhurst/TUnit/sessions/48d47cff-3125-44ff-b19b-e1dfe712be9f

Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement multi step test execution with OTEL and Aspire Show multi-step test spans in class timeline and align report ordering with execution May 7, 2026
Copilot AI requested a review from thomhurst May 7, 2026 11:23
Copilot AI temporarily deployed to Pull Requests May 7, 2026 11:27 Inactive
Copilot AI temporarily deployed to Pull Requests May 7, 2026 11:27 Inactive
Copilot AI temporarily deployed to Pull Requests May 7, 2026 11:27 Inactive
@thomhurst
Copy link
Copy Markdown
Owner

@copilot read the latest comments on the issue. You haven't addressed the missing OTel activities.

Agent-Logs-Url: https://github.com/thomhurst/TUnit/sessions/5339a2a6-32c0-4e8e-b65a-72c686b6873e

Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Copilot AI and others added 5 commits May 7, 2026 13:23
Agent-Logs-Url: https://github.com/thomhurst/TUnit/sessions/5339a2a6-32c0-4e8e-b65a-72c686b6873e

Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Agent-Logs-Url: https://github.com/thomhurst/TUnit/sessions/5339a2a6-32c0-4e8e-b65a-72c686b6873e

Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Agent-Logs-Url: https://github.com/thomhurst/TUnit/sessions/5339a2a6-32c0-4e8e-b65a-72c686b6873e

Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Agent-Logs-Url: https://github.com/thomhurst/TUnit/sessions/5339a2a6-32c0-4e8e-b65a-72c686b6873e

Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Agent-Logs-Url: https://github.com/thomhurst/TUnit/sessions/5339a2a6-32c0-4e8e-b65a-72c686b6873e

Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 7, 2026

@copilot read the latest comments on the issue. You haven't addressed the missing OTel activities.

Addressed in ec211ae. The OTLP receiver now maps derived/linked traces back to the owning test when incoming spans carry links to the original test trace, and the activity collector now accepts registry-backed external traces so those activities show up in the report. I also added a regression test that posts a linked OTLP trace payload through /v1/traces to cover this path.

Copilot AI changed the title Show multi-step test spans in class timeline and align report ordering with execution Show multi-step test spans in class timeline, align report ordering with execution, and correlate linked OTel activities May 7, 2026
Copilot AI temporarily deployed to Pull Requests May 7, 2026 13:45 Inactive
Copilot AI temporarily deployed to Pull Requests May 7, 2026 13:45 Inactive
Copilot AI temporarily deployed to Pull Requests May 7, 2026 13:45 Inactive
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.

[Feature]: Multi step test execution with OTEL and Aspire (Gherkin - BDD style)

2 participants