Skip to content

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

Merged
thomhurst merged 18 commits into
mainfrom
copilot/feature-multi-step-test-execution
May 10, 2026
Merged

Show multi-step test spans in class timeline, align report ordering with execution, and correlate linked OTel activities#5847
thomhurst merged 18 commits into
mainfrom
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

Not up to standards ⛔

🔴 Issues 1 high · 2 minor

Alerts:
⚠ 3 issues (≤ 0 issues of at least minor severity)

Results:
3 new issues

Category Results
Security 1 high
CodeStyle 2 minor

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

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
github-actions Bot pushed a commit to IntelliTect/CodingGuidelines that referenced this pull request May 11, 2026
Updated [TUnit.Core](https://github.com/thomhurst/TUnit) from 1.43.11 to
1.44.0.

<details>
<summary>Release notes</summary>

_Sourced from [TUnit.Core's
releases](https://github.com/thomhurst/TUnit/releases)._

## 1.44.0

<!-- Release notes generated using configuration in .github/release.yml
at v1.44.0 -->

## What's Changed
### Other Changes
* Generated mocks live in the same namespace as the mocked type by
@​thomhurst in thomhurst/TUnit#5870
* Show multi-step test spans in class timeline, align report ordering
with execution, and correlate linked OTel activities by @​Copilot in
thomhurst/TUnit#5847
* fix: don't leak RUC onto Should-style comparer overloads (#​5857) by
@​thomhurst in thomhurst/TUnit#5873
* Fix culture-dependent timestamp in HTML test report (#​5868) by
@​thomhurst in thomhurst/TUnit#5872
* fix(mocks-http): auto-prepend `/` to partial endpoint paths (#​5838)
by @​thomhurst in thomhurst/TUnit#5874
* Replace Report.ExpandClassTimeline with [ClassTimeline] attribute by
@​thomhurst in thomhurst/TUnit#5875
* feat(assertions): make ShouldAssertion<T> implement IAssertion
(#​5824) by @​thomhurst in thomhurst/TUnit#5876
* feat(mocks): support non-span ref struct out/ref params by @​thomhurst
in thomhurst/TUnit#5878
* fix(core): fill optional params when invoking MethodDataSource via
reflection by @​thomhurst in
thomhurst/TUnit#5880
* Mocks: structural fix for Mock<T> / mocked-member name collisions by
@​thomhurst in thomhurst/TUnit#5881
* chore(mocks): promote TUnit.Mocks packages to stable by @​thomhurst in
thomhurst/TUnit#5877
### Dependencies
* chore(deps): update tunit to 1.43.41 by @​thomhurst in
thomhurst/TUnit#5863
* chore(deps): update dependency tunit.assertions.fsharp to 1.43.41 by
@​thomhurst in thomhurst/TUnit#5865
* chore(deps): bump @​babel/plugin-transform-modules-systemjs from
7.28.5 to 7.29.4 in /docs by @​dependabot[bot] in
thomhurst/TUnit#5867
* chore(deps): bump fast-uri from 3.1.0 to 3.1.2 in /docs by
@​dependabot[bot] in thomhurst/TUnit#5862


**Full Changelog**:
thomhurst/TUnit@v1.43.41...v1.44.0

## 1.43.41

<!-- Release notes generated using configuration in .github/release.yml
at v1.43.41 -->

## What's Changed
### Other Changes
* feat(playwright): expose default Context/Launch options on settings by
@​thomhurst in thomhurst/TUnit#5861
* fix(hooks): resolve TestDiscovery hook context type by attribute kind,
not method name by @​thomhurst in
thomhurst/TUnit#5860
### Dependencies
* chore(deps): update tunit to 1.43.38 by @​thomhurst in
thomhurst/TUnit#5858


**Full Changelog**:
thomhurst/TUnit@v1.43.38...v1.43.41

## 1.43.38

<!-- Release notes generated using configuration in .github/release.yml
at v1.43.38 -->

## What's Changed
### Other Changes
* feat(playwright): add TUnitPlaywrightSettings defaults by @​thomhurst
in thomhurst/TUnit#5859


**Full Changelog**:
thomhurst/TUnit@v1.43.37...v1.43.38

## 1.43.37

<!-- Release notes generated using configuration in .github/release.yml
at v1.43.37 -->

## What's Changed
### Other Changes
* docs: clarify MethodDataSourceAttribute.Factory is
source-generator-managed by @​Copilot in
thomhurst/TUnit#5835
* fix(assertions): skip ref-struct members in IsEquivalentTo (#​5841) by
@​thomhurst in thomhurst/TUnit#5842
* feat(playwright): add composition-based fixtures by @​thomhurst in
thomhurst/TUnit#5840
### Dependencies
* chore(deps): update tunit to 1.43.11 by @​thomhurst in
thomhurst/TUnit#5821
* chore(deps): update dependency polyfill to 10.4.0 by @​thomhurst in
thomhurst/TUnit#5830
* chore(deps): update dependency polyfill to 10.4.0 by @​thomhurst in
thomhurst/TUnit#5829
* chore(deps): update react to ^19.2.6 by @​thomhurst in
thomhurst/TUnit#5839
* chore(deps): update dependency polyfill to 10.5.0 by @​thomhurst in
thomhurst/TUnit#5848
* chore(deps): update dependency polyfill to 10.5.0 by @​thomhurst in
thomhurst/TUnit#5849
* chore(deps): update aspire to 13.3.0 by @​thomhurst in
thomhurst/TUnit#5851
* chore(deps): update dependency brace-expansion to v5.0.6 by
@​thomhurst in thomhurst/TUnit#5853
* chore(deps): update dependency polyfill to 10.5.1 by @​thomhurst in
thomhurst/TUnit#5854
* chore(deps): update dependency polyfill to 10.5.1 by @​thomhurst in
thomhurst/TUnit#5855
* chore(deps): update verify to 31.16.3 by @​thomhurst in
thomhurst/TUnit#5856


**Full Changelog**:
thomhurst/TUnit@v1.43.11...v1.43.37

Commits viewable in [compare
view](thomhurst/TUnit@v1.43.11...v1.44.0).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=TUnit.Core&package-manager=nuget&previous-version=1.43.11&new-version=1.44.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced May 11, 2026
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)

3 participants