Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FilePosition in FileSelector and ClasspathResourceSelector #2253

Merged
merged 29 commits into from
May 22, 2020
Merged

Conversation

timtebeek
Copy link
Contributor

@timtebeek timtebeek commented Apr 10, 2020

Overview

Fixes #2146.


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

@codecov
Copy link

codecov bot commented Apr 10, 2020

Codecov Report

Merging #2253 into master will decrease coverage by 0.04%.
The diff coverage is 82.35%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2253      +/-   ##
============================================
- Coverage     90.41%   90.36%   -0.05%     
- Complexity     4479     4512      +33     
============================================
  Files           391      392       +1     
  Lines         10887    10943      +56     
  Branches        875      891      +16     
============================================
+ Hits           9843     9889      +46     
- Misses          780      785       +5     
- Partials        264      269       +5     
Impacted Files Coverage Δ Complexity Δ
.../junit/platform/engine/discovery/FileSelector.java 68.75% <66.66%> (-2.68%) 9.00 <3.00> (+2.00) ⬇️
...rm/engine/discovery/ClasspathResourceSelector.java 70.58% <75.00%> (+1.35%) 9.00 <4.00> (+3.00)
.../junit/platform/engine/discovery/FilePosition.java 82.97% <82.97%> (ø) 25.00 <25.00> (?)
.../platform/engine/discovery/DiscoverySelectors.java 89.79% <100.00%> (+0.32%) 34.00 <4.00> (+3.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 a9e8a61...2fbc96d. Read the comment docs.

Copy link
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

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

Looks good except for a few details! Most importantly, we should decide what the factory methods in DiscoverySelectors should look like.

@timtebeek
Copy link
Contributor Author

timtebeek commented Apr 10, 2020

Ok I've hopefully addressed all of your suggestions as intended; I hope it's ok I marked them as "resolved"; If I shouldn't have done that please let me know!

The only outstanding issue (I think) is this slight gaffe on my part where I need some direction: https://github.com/junit-team/junit5/pull/2253/files#r406852337

Since resolved in decb669

@timtebeek timtebeek requested a review from marcphilipp April 10, 2020 20:15
@timtebeek
Copy link
Contributor Author

Just noticed 1978513 in master; with this PR added to the 5.7 M2 milestone, should I merge in master and add a rough outline for the changes contained in this PR?

I know this isn't a high priority new feature or fix, but would nonetheless be nice to see this finished if possible, before any other branches introduce conflicts. :)

@marcphilipp
Copy link
Member

@timtebeek Sorry for the delay. We discussed it briefly in the last team call. The current solution still contains breaking changes so we were a bit torn whether to just duplicate the FilePosition class to avoid the messy (not your fault!) deprecation work and the confusion caused by it. Would you mind changing this PR so the FilePosition class and its tests are copied and the deprecation is reverted? Sorry for the back ans forth! As for the release notes: yes, please rebase on master and add a bullet point.

@timtebeek timtebeek requested a review from marcphilipp May 2, 2020 10:50
@timtebeek
Copy link
Contributor Author

@marcphilipp No problem at all; I've reverted the deprecation changes, created a clean copy of FilePosition and updated the release notes. Could you have another look? :)

@timtebeek
Copy link
Contributor Author

@marcphilipp any update on this issue? Just trying to keep this flowing through; if there's any changes I have to make still let me know!

@marcphilipp marcphilipp requested review from juliette-derancourt and removed request for marcphilipp May 15, 2020 10:43
Copy link
Member

@juliette-derancourt juliette-derancourt left a comment

Choose a reason for hiding this comment

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

Hey @timtebeek, left you a few comments/suggestions on the PR! :)

@timtebeek
Copy link
Contributor Author

@juliette-derancourt Thanks a lot for the detailed feedback; I've applied all your suggestions. Let me know if there's anything else! :)

Copy link
Member

@juliette-derancourt juliette-derancourt left a comment

Choose a reason for hiding this comment

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

Thank you for making the changes @timtebeek, looks good to me! 👍

* @since 1.7
*/
@API(status = STABLE, since = "1.7")
public class FilePosition implements Serializable {

Choose a reason for hiding this comment

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

@junit-team/junit-lambda Should we mention in the Javadoc that this class is actually a copy of descriptor.FilePosition?

@juliette-derancourt juliette-derancourt changed the title Add FilePosition in FileSelector and ClasspathResourceSelector for #2146 Add FilePosition in FileSelector and ClasspathResourceSelector May 16, 2020
@juliette-derancourt juliette-derancourt merged commit 375792d into junit-team:master May 22, 2020
@juliette-derancourt
Copy link
Member

Thanks for the PR @timtebeek!

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.

Support FilePosition in discovery selectors
4 participants