-
Notifications
You must be signed in to change notification settings - Fork 568
Improve coverage support for packages (fixes #2276) #2281
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
Improve coverage support for packages (fixes #2276) #2281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not compare objects with ==
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write a todo to remove this as soon as multiple packages coverage will be supported with the link to corresponding issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it is quite bad and inconsistent solution, it won't work good if testing directory is not equal to working directory
|
Updated. Thank you. |
Still actual |
|
I've totally missed that notification, sorry. |
|
Updated and improved (hopefully). |
|
Looks good, thanks. But now it won't work if testing directory is outside of working directory :) |
I've tested with the working directory being a parent and even a different leaf of the same parent and they worked both (second one needed "convincing" but still worked). Can you please provide a sample of what's not working? Thank you. |
|
@dlsniper empty dir path, empty working dir path, directories on different drive – anything that lead to null relative path leads to incorrect work of your patch |
|
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now flow is overcomplicated. Path can end with separator only if relativePath is not null and appending it with File.separator makes sense only if it's not coverage run. As a result you make 3 ifs instead 2.
The only thing you change is path suffix ("..." or "."), you can extract it in variable and append it to executor for both cases (with null relativePath and notnull relativePath). It requires only 1 new line and simple modification of 2 other lines, without any extra ifs, adding separators, etc.
|
Done. It does indeed look much better. |
Improve coverage support for packages (fixes #2276)
Technically only directory run configs have this issue (package running doesn't support specifying
...yet, I'll do a different PR for that if it's deemed of interested, so far no such request tho).