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

test: Convert explain count tests to new explain setup #1488

Conversation

shahzadlone
Copy link
Member

@shahzadlone shahzadlone commented May 10, 2023

Relevant issue(s)

Description

Continue converting explain tests to the new explain setup before we can integrate the entire setup to the new action-based setup. #953 Has a lot more detail on the entire plan.

  • This PR converts all the default explain count tests.
  • Splits count join tests in a separate file.
  • Adds some new tests that were missed before.

sources in one count request, and convert all the tests to the new
explain setup.
@shahzadlone shahzadlone added area/testing Related to any test or testing suite code quality Related to improving code quality labels May 10, 2023
@shahzadlone shahzadlone added this to the DefraDB v0.5.1 milestone May 10, 2023
@shahzadlone shahzadlone requested a review from a team May 10, 2023 20:11
@shahzadlone shahzadlone self-assigned this May 10, 2023
@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Merging #1488 (c1e487b) into develop (864b3db) will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1488      +/-   ##
===========================================
+ Coverage    72.12%   72.18%   +0.06%     
===========================================
  Files          185      185              
  Lines        18239    18239              
===========================================
+ Hits         13154    13166      +12     
+ Misses        4041     4035       -6     
+ Partials      1044     1038       -6     

see 9 files with indirect coverage changes

@shahzadlone shahzadlone force-pushed the test/refactor-count-explain-tests branch from de0be7c to b549e6c Compare May 10, 2023 23:42
Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

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

LGTM. Just one question :)

{
TargetNodeName: "scanNode", // inside of root
OccurancesToSkip: 0,
IncludeChildNodes: true, // should be leaf of it's branch, so will have no child nodes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: I saw this on the other PR I approved but now I'm starting to scratch my head when looking at the comment. Is it normal that the field says true to include child nodes but the comment says "will have no child node"?

Copy link
Member Author

Choose a reason for hiding this comment

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

scanNode is a special case as it should be the last node (leaf) in all these cases. The IncludeChildNodes: true is there to ensure that there are no nodes inside / under the scanNode. If some child nodes were ever introduced in the future, it would ensure to fail the test (as assumptions have changed) and should deliberately handle/change the test then based on the new change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok thanks for the explanation. I do feel like the name is a little misleading though. Out of scope here of course but maybe something we can revisit later?

Copy link
Member Author

Choose a reason for hiding this comment

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

IncludeChildNodes includes child nodes if they are available. I thought it covered the purpose well. Open to suggestions if you have any?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh! I get it now. It’s the comment on hat threw me off. I thought the comment was saying that we set it to true because there will be no child nodes. Not “although” it’s set to true, there will be no child nodes.

@shahzadlone shahzadlone force-pushed the test/refactor-count-explain-tests branch from b549e6c to c1e487b Compare May 11, 2023 08:03
@shahzadlone shahzadlone merged commit 79af741 into sourcenetwork:develop May 11, 2023
9 checks passed
@shahzadlone shahzadlone deleted the test/refactor-count-explain-tests branch May 11, 2023 08:18
shahzadlone added a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
…#1488)

## Relevant issue(s)
- Part of sourcenetwork#953
- Resolves sourcenetwork#1486 

## Description
Continue converting explain tests to the new explain setup before we can
integrate the entire setup to the new action-based setup. sourcenetwork#953 Has a lot
more detail on the entire plan.

- This PR converts all the default explain count tests.
- Splits count join tests in a separate file.
- Adds some new tests that were missed before.
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 code quality Related to improving code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert default count explain tests to new explain setup
2 participants