maven-surefire-junit5-tree-reporter icon indicating copy to clipboard operation
maven-surefire-junit5-tree-reporter copied to clipboard

Nested test tree not formatted correctly

Open tmarback opened this issue 1 year ago • 1 comments

Reproducer: https://github.com/tmarback/tree-reporter-issue

When using nested tests, the "bars" that draw the test tree are incorrect, with the horizontal lines for the test classes originating a layer above where they should:

(note how for the 1st-level nested classes the horizontal line crosses 2 different vertical lines, while on the 2nd-level nested classes the horizonal line goes past the vertical line)

PS <snip>\tree-reporter> mvn test
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------------< test:tree-reporter >-------------------------
[INFO] Building tree-reporter 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
<snip>
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] +--Outer - 0.056s
[INFO] |  +-- [OK] testOuter1 - 0.016s
[INFO] |  +-- [OK] testOuter2 - 0s
[INFO] |  '-- [OK] testOuter3 - 0s
[INFO] +--.--Outer Inner 2 - 0.005s
[INFO] |  |  +-- [OK] testInner1 - 0.001s
[INFO] |  |  +-- [OK] testInner2 - 0.001s
[INFO] |  |  '-- [OK] testInner3 - 0.001s
[INFO] +--.--Outer Inner 3 - 0.005s
[INFO] |  |  +-- [OK] testInner1 - 0s
[INFO] |  |  +-- [OK] testInner2 - 0.001s
[INFO] |  |  '-- [OK] testInner3 - 0s
[INFO] |  '--.--Outer Inner 3 Inner-er 2 - 0.013s
[INFO] |     |  +-- [OK] testInnerer1 - 0.001s
[INFO] |     |  +-- [OK] testInnerer2 - 0s
[INFO] |     |  '-- [OK] testInnerer3 - 0s
[INFO] |  '--.--Outer Inner 3 Inner-er 3 - 0.013s
[INFO] |     |  +-- [OK] testInnerer1 - 0s
[INFO] |     |  +-- [OK] testInnerer2 - 0s
[INFO] |     |  '-- [OK] testInnerer3 - 0.001s
[INFO] |  '--.--Outer Inner 3 Inner-er 1 - 0.013s
[INFO] |     |  +-- [OK] testInnerer1 - 0s
[INFO] |     |  +-- [OK] testInnerer2 - 0.001s
[INFO] |     |  '-- [OK] testInnerer3 - 0s
[INFO] +-----Outer Inner 1 - 0.005s
[INFO] |     +-- [OK] testInner1 - 0s
[INFO] |     +-- [OK] testInner2 - 0.001s
[INFO] |     '-- [OK] testInner3 - 0s
[INFO] 
[INFO] Results:
[INFO]
[INFO] Tests run: 21, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.787 s
[INFO] Finished at: 2023-05-18T03:39:04-07:00
[INFO] ------------------------------------------------------------------------

Also the @DisplayName names seem to be getting appended at each level, which from the examples doesn't seem to be the expected.

tmarback avatar May 18 '23 10:05 tmarback

Sorry for the delay and thanks for pointing out, I'll try working on this issue as soon as I can

fabriciorby avatar Jul 31 '23 15:07 fabriciorby