Skip to content

Conversation

@americodls
Copy link

@americodls americodls commented Oct 2, 2025

Why?

Span names and full descriptions for RSpec one-liner syntax (like it { is_expected.not_to be_nil }) were incorrectly showing file locations instead of the matcher-generated descriptions. This made tracing output less useful for tests using the concise one-liner syntax.

How?

RSpec generates descriptions for one-liner examples after execution, when the matcher runs. The formatter was capturing description and full_description at example_started time, before these values were populated.

The fix updates both the span name and full_description attribute in the example_finished callback, after RSpec has generated the proper description from the matcher. This ensures accurate span names and descriptions for both one-liner and traditional examples.

We need to point Intercom's Gemfile to this repo so that we get those updates without waiting for the upstream repo to accept them.


Note: Upstream PR created at open-telemetry#1712

RSpec one-liner examples (e.g., `it { is_expected.not_to be_nil }`)
generate descriptions after execution. Updated formatter to capture
the final description in `example_finished` instead of relying on
the incomplete description at `example_started`.
@americodls americodls changed the title Fix RSpec one-liner example descriptions fix: RSpec one-liner example descriptions Oct 2, 2025
@americodls americodls merged commit c8d2f6a into main Oct 2, 2025
64 of 65 checks passed
americodls added a commit that referenced this pull request Oct 8, 2025
## Why?

Span names and full descriptions for RSpec one-liner syntax (like `it {
is_expected.not_to be_nil }`) were incorrectly showing file locations
instead of the matcher-generated descriptions. This made tracing output
less useful for tests using the concise one-liner syntax.

## How?

RSpec generates descriptions for one-liner examples after execution,
when the matcher runs. The formatter was capturing `description` and
`full_description` at `example_started` time, before these values were
populated.

The fix updates both the span name and `full_description` attribute in
the `example_finished` callback, after RSpec has generated the proper
description from the matcher. This ensures accurate span names and
descriptions for both one-liner and traditional examples.

We need to point Intercom's Gemfile to this repo so that we get those
updates without waiting for the upstream repo to accept them.

---

**Note:** Upstream PR created at
open-telemetry#1712
americodls added a commit that referenced this pull request Oct 12, 2025
## Why?

Span names and full descriptions for RSpec one-liner syntax (like `it {
is_expected.not_to be_nil }`) were incorrectly showing file locations
instead of the matcher-generated descriptions. This made tracing output
less useful for tests using the concise one-liner syntax.

## How?

RSpec generates descriptions for one-liner examples after execution,
when the matcher runs. The formatter was capturing `description` and
`full_description` at `example_started` time, before these values were
populated.

The fix updates both the span name and `full_description` attribute in
the `example_finished` callback, after RSpec has generated the proper
description from the matcher. This ensures accurate span names and
descriptions for both one-liner and traditional examples.

We need to point Intercom's Gemfile to this repo so that we get those
updates without waiting for the upstream repo to accept them.

---

**Note:** Upstream PR created at
open-telemetry#1712
americodls added a commit that referenced this pull request Oct 14, 2025
## Why?

Span names and full descriptions for RSpec one-liner syntax (like `it {
is_expected.not_to be_nil }`) were incorrectly showing file locations
instead of the matcher-generated descriptions. This made tracing output
less useful for tests using the concise one-liner syntax.

## How?

RSpec generates descriptions for one-liner examples after execution,
when the matcher runs. The formatter was capturing `description` and
`full_description` at `example_started` time, before these values were
populated.

The fix updates both the span name and `full_description` attribute in
the `example_finished` callback, after RSpec has generated the proper
description from the matcher. This ensures accurate span names and
descriptions for both one-liner and traditional examples.

We need to point Intercom's Gemfile to this repo so that we get those
updates without waiting for the upstream repo to accept them.

---

**Note:** Upstream PR created at
open-telemetry#1712
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.

3 participants