Skip to content

Allow @Nested test classes to be ordered#2701

Closed
sbrannen wants to merge 4 commits intojunit-team:mainfrom
sbrannen:issues/2699-order-nested-test-classes
Closed

Allow @Nested test classes to be ordered#2701
sbrannen wants to merge 4 commits intojunit-team:mainfrom
sbrannen:issues/2699-order-nested-test-classes

Conversation

@sbrannen
Copy link
Copy Markdown
Member

@sbrannen sbrannen commented Aug 28, 2021

Overview

PR #2488 introduced support for ordering top-level test classes but did not provide support for ordering @Nested test classes.

This PR adds support for ordering @Nested test classes as well.

Closes: #2699

Definition of Done

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 28, 2021

Codecov Report

Merging #2701 (a8ef251) into main (a2c5f86) will increase coverage by 0.02%.
The diff coverage is 93.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2701      +/-   ##
==========================================
+ Coverage   91.40%   91.43%   +0.02%     
==========================================
  Files         427      427              
  Lines       12116    12149      +33     
  Branches      948      951       +3     
==========================================
+ Hits        11075    11108      +33     
  Misses        801      801              
  Partials      240      240              
Impacted Files Coverage Δ
.../main/java/org/junit/jupiter/api/ClassOrderer.java 86.11% <ø> (ø)
...main/java/org/junit/jupiter/api/MethodOrderer.java 100.00% <ø> (ø)
...piter/engine/discovery/DefaultClassDescriptor.java 75.00% <ø> (ø)
...iter/engine/discovery/DefaultMethodDescriptor.java 75.00% <ø> (ø)
...jupiter/engine/discovery/ClassOrderingVisitor.java 80.76% <78.26%> (+12.01%) ⬆️
.../discovery/AbstractAnnotatedDescriptorWrapper.java 69.23% <100.00%> (ø)
...iter/engine/discovery/AbstractOrderingVisitor.java 100.00% <100.00%> (ø)
.../engine/discovery/DefaultMethodOrdererContext.java 77.77% <100.00%> (ø)
...upiter/engine/discovery/MethodOrderingVisitor.java 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2c5f86...a8ef251. Read the comment docs.

@sbrannen sbrannen force-pushed the issues/2699-order-nested-test-classes branch from d0531d8 to 96cd909 Compare August 28, 2021 15:55
@sbrannen
Copy link
Copy Markdown
Member Author

This PR now includes a new @TestClassOrder annotation for ordering @Nested test classes declaratively.

Once this PR has been approved, I will update the release notes and user guide accordingly.

Copy link
Copy Markdown
Member

@sormuras sormuras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and should ship with 5.8.0

PR junit-team#2488 introduced support for ordering top-level test classes but
did not provide support for ordering @nested test classes.

This commit adds support for ordering @nested test classes.

See: junit-team#2699
This commit builds on the previous commit by introducing a new
@TestClassOrder annotation that can be used to configure a ClassOrderer
for @nested test classes.

A @TestClassOrder declaration always overrides a globally configured
ClassOrderer.

See: junit-team#2699
@sbrannen sbrannen force-pushed the issues/2699-order-nested-test-classes branch from 37fc875 to a8ef251 Compare August 30, 2021 14:28
@sbrannen
Copy link
Copy Markdown
Member Author

sbrannen commented Aug 30, 2021

This has been merged into main.

@sbrannen sbrannen closed this Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow @Nested test classes to be ordered

2 participants