twitter / util

Wonderful reusable code from Twitter
https://twitter.github.io/util
Apache License 2.0
2.69k stars 581 forks source link

util-core: improve test coverage for Cancellable #270

Closed muachilin closed 4 years ago

muachilin commented 4 years ago

Problem

The test coverage of Cancellable still needs to be improved. Particularly the object of Cancellable has not been tested.

Solution

Add more tests for Cancellable.

Result

Improve the test coverage for Cancellable.

muachilin commented 4 years ago

Hello @ryanoneill, I created this pull request with only the file changes for testing Cancellable. Would you please check whether the patch is clean or not? Thank you very much!

codecov-io commented 4 years ago

Codecov Report

Merging #270 into develop will increase coverage by 0.06%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #270      +/-   ##
===========================================
+ Coverage       46%   46.07%   +0.06%     
===========================================
  Files          228      228              
  Lines        14443    14443              
  Branches       889      922      +33     
===========================================
+ Hits          6645     6654       +9     
+ Misses        7798     7789       -9
Impacted Files Coverage Δ
...core/src/main/scala/com/twitter/util/Promise.scala 77.95% <0%> (+0.4%) :arrow_up:
...in/scala/com/twitter/logging/QueueingHandler.scala 100% <0%> (+6.06%) :arrow_up:
.../src/main/scala/com/twitter/util/Cancellable.scala 100% <0%> (+75%) :arrow_up:

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 36c56e8...49cb8ed. Read the comment docs.

ryanoneill commented 4 years ago

Thank you. I'm handling this internally now. I'll post back when the commit has been pushed back to GitHub.

ryanoneill commented 4 years ago

Thanks again @muachilin. This was pushed back out to GitHub as commit https://github.com/twitter/util/commit/41227fa84087375ae8d1def4c04eadaba64f30e5

muachilin commented 4 years ago

Thank you :)