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

Improve test coverage #19

Merged
merged 20 commits into from
Oct 7, 2022
Merged

Improve test coverage #19

merged 20 commits into from
Oct 7, 2022

Conversation

7hong13
Copy link
Contributor

@7hong13 7hong13 commented Oct 6, 2022

What this PR does / why we need it?

This PR is to improve test coverage based on the result from previous PR.

Any background context you want to provide?

CrdtArray has low test coverage since its overriding functions are not implemented yet.

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

@7hong13 7hong13 self-assigned this Oct 6, 2022
@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Merging #19 (8a3db8b) into main (f4f9302) will increase coverage by 0.57%.
The diff coverage is 45.45%.

@@             Coverage Diff              @@
##               main      #19      +/-   ##
============================================
+ Coverage     64.99%   65.56%   +0.57%     
- Complexity      157      176      +19     
============================================
  Files            17       21       +4     
  Lines           557      604      +47     
  Branches         97       99       +2     
============================================
+ Hits            362      396      +34     
- Misses          142      145       +3     
- Partials         53       63      +10     
Impacted Files Coverage Δ
.../main/kotlin/dev/yorkie/document/crdt/CrdtArray.kt 54.54% <33.33%> (+25.97%) ⬆️
...ain/kotlin/dev/yorkie/document/crdt/RgaTreeList.kt 77.22% <60.00%> (+15.22%) ⬆️
...main/kotlin/dev/yorkie/document/time/TimeTicket.kt 92.30% <0.00%> (-7.70%) ⬇️
...c/main/kotlin/dev/yorkie/document/change/Change.kt 0.00% <0.00%> (ø)
...main/kotlin/dev/yorkie/document/change/ChangeID.kt 0.00% <0.00%> (ø)
.../kotlin/dev/yorkie/document/operation/Operation.kt 0.00% <0.00%> (ø)
...kotlin/dev/yorkie/document/change/ChangeContext.kt 0.00% <0.00%> (ø)
...c/main/kotlin/dev/yorkie/document/crdt/CrdtRoot.kt 0.00% <0.00%> (ø)
...ie/src/main/kotlin/dev/yorkie/util/SplayTreeSet.kt 77.18% <0.00%> (+2.91%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@skhugh skhugh left a comment

Choose a reason for hiding this comment

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

I left a couple comments but they are not something that have to be fixed here :)

/**
* Returns the creation time of the last element.
*/
fun getLastCreatedAt(): TimeTicket {
Copy link
Contributor

Choose a reason for hiding this comment

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

Although it is only my personal preference, I would use property rather than functions when it always returns the same instance and has no parameters.
(same for RgaTreeList.getHead)

Copy link
Member

Choose a reason for hiding this comment

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

If there are no problems, it would be better to unify the style. The proposed method is looking neater.

@@ -2,14 +2,13 @@ package dev.yorkie.document.crdt

import dev.yorkie.document.time.TimeTicket
import dev.yorkie.document.time.TimeTicket.Companion.InitialTimeTicket
import dev.yorkie.document.time.TimeTicket.Companion.compareTo
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like some of the work I've done got reverted on merge.
check 9e1f465#diff-d11a0b42e2590d7cdb00a3e25077e19cd889cc034a160dd3a99cea4c352adca4R86

Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. Please check the comments suggested by @skhugh.

/**
* Returns the creation time of the last element.
*/
fun getLastCreatedAt(): TimeTicket {
Copy link
Member

Choose a reason for hiding this comment

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

If there are no problems, it would be better to unify the style. The proposed method is looking neater.

@7hong13 7hong13 merged commit af45086 into main Oct 7, 2022
@7hong13 7hong13 deleted the array branch October 7, 2022 01:24
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.

3 participants