Skip to content

feat(terminal): show a data provider's description once at the batch node#255

Merged
roxblnfk merged 1 commit into
1.xfrom
feature/dataprovider-description-once
Jul 3, 2026
Merged

feat(terminal): show a data provider's description once at the batch node#255
roxblnfk merged 1 commit into
1.xfrom
feature/dataprovider-description-once

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Jul 3, 2026

Copy link
Copy Markdown
Member

What was changed

The terminal renderer used to copy a test's description onto every data set,
so a test with a #[DataProvider] repeated the same description line under
each generated data set. Now the description is printed once under the batch
node (the root of the data set tree) and suppressed on the individual data
sets. A test without a data provider keeps printing its description as before.

Before:

 DataProviders [test]
   ◆ sum
     ✓ Dataset #0:0 [0]
       Several DataProvider and DataSet attributes on one method are all collected: ...
     ✓ Dataset #0:1 [1]
       Several DataProvider and DataSet attributes on one method are all collected: ...
     ...

After:

 DataProviders [test]
   ◆ sum
     Several DataProvider and DataSet attributes on one method are all collected: ...
     ✓ Dataset #0:0 [0]
     ✓ Dataset #0:1 [1]
     ...

Implementation:

  • Extracted the description block formatting from Formatter::formatCompactRun()
    into a reusable Formatter::description().
  • TerminalLogger::batchStartedFromInfo() now prints the description once, from
    TestDefinition::getDescription() (same source TeamcityLogger already uses).
  • TerminalLogger suppresses the per-result description while inside a batch.

Why?

The duplicated description was pure noise: identical text repeated for every
data set pushed the actual results down and made data-heavy providers hard to
read. The description belongs to the method, so it should appear once at the
root of the data set tree.

Checklist

  • Tested
    • Tested manually
    • Unit tests added

…node

A test's description belongs to the method, not to each data set. The
terminal renderer copied it from every data set result, so a DataProvider
test repeated the same description under each data set. Print it once under
the batch node (the root of the data set tree) and suppress it on the
individual data sets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@roxblnfk roxblnfk requested a review from a team as a code owner July 3, 2026 10:37
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.66667% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
core/Output/Terminal/Renderer/Formatter.php 0.00% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@roxblnfk roxblnfk merged commit 2274e6a into 1.x Jul 3, 2026
24 of 27 checks passed
@roxblnfk roxblnfk deleted the feature/dataprovider-description-once branch July 3, 2026 10:40
@roxblnfk roxblnfk mentioned this pull request Jul 3, 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.

1 participant