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

chore: Remove dead code from multi node #186

Merged
merged 3 commits into from
Feb 11, 2022

Conversation

AndrewSisley
Copy link
Contributor

Closes #184

Couldn't find a way to re-open original PR: #185 (maybe permission thing, button was disabled).

@AndrewSisley AndrewSisley added the area/testing Related to any test or testing suite label Feb 7, 2022
@AndrewSisley AndrewSisley self-assigned this Feb 7, 2022
@codecov
Copy link

codecov bot commented Feb 7, 2022

Codecov Report

Merging #186 (db82554) into develop (5799ca7) will decrease coverage by 0.00%.
The diff coverage is 15.78%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #186      +/-   ##
===========================================
- Coverage    57.43%   57.42%   -0.01%     
===========================================
  Files           98       98              
  Lines         9643     9616      -27     
===========================================
- Hits          5538     5522      -16     
+ Misses        3491     3479      -12     
- Partials       614      615       +1     
Impacted Files Coverage Δ
query/graphql/planner/multi.go 60.75% <15.78%> (+0.21%) ⬆️

if err := node.AddChild(field, plan); err != nil {
return err
}
} else { // no multiscan, case B)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't spot how this case is possible - if you know, please let me know and I'll try test it

Copy link
Member

Choose a reason for hiding this comment

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

Traced things through, and I can't see how it is possible either, good catch!

case mergeNode:
if ms := node.Source(); s != nil { // yes, we have a multiscan node. Case A)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually looks like a typo ms := ...; s !=...

Copy link
Member

Choose a reason for hiding this comment

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

👀, indeed it is, oddly enough, I checked it locally and all the tests still pass with the correction.

@jsimnz
Copy link
Member

jsimnz commented Feb 9, 2022

Can't tell if im confused or dumb. I first thought based on the issue and PR title you were adding tests to explicitly cover the multiNode code. Are you trying to "increase" coverage by just removing dead code? Since the changes don't effect any test file.

@AndrewSisley
Copy link
Contributor Author

AndrewSisley commented Feb 9, 2022

Can't tell if im confused or dumb. I first thought based on the issue and PR title you were adding tests to explicitly cover the multiNode code. Are you trying to "increase" coverage by just removing dead code? Since the changes don't effect any test file.

Yeah, is a bit misleading - intention was to write more tests, but I couldn't find a way to hit the codeblocks with existing node

@jsimnz
Copy link
Member

jsimnz commented Feb 9, 2022

We can certainly do more w.r.t unit testing the planner package in general. Do you want to rename the PR to more accureately reflect the removal of dead/uselss/not reachable code within the multiNode implemenation, or do you want to add unit tests. I assume the former.

@AndrewSisley
Copy link
Contributor Author

We can certainly do more w.r.t unit testing the planner package in general. Do you want to rename the PR to more accureately reflect the removal of dead/uselss/not reachable code within the multiNode implemenation, or do you want to add unit tests. I assume the former.

I can rename the PR.

@AndrewSisley AndrewSisley changed the title test: Expand multi node test coverage test: Remove dead code from multi node Feb 9, 2022
@AndrewSisley AndrewSisley changed the title test: Remove dead code from multi node chore: Remove dead code from multi node Feb 9, 2022
Copy link
Member

@jsimnz jsimnz left a comment

Choose a reason for hiding this comment

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

LGTM

@AndrewSisley AndrewSisley merged commit 27db5f5 into develop Feb 11, 2022
@AndrewSisley AndrewSisley deleted the sisley/test/I184-multi-code-cov branch February 11, 2022 14:40
@shahzadlone shahzadlone mentioned this pull request May 27, 2022
18 tasks
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
* Remove dead MultiNode merge code

* Remove commented out code

* Remove impossible code block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Related to any test or testing suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi.go code coverage is low
2 participants