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: Add tests for grouping by undefined value #543

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #409

Description

Adds tests for grouping by undefined value. Was a bit surprised that this already works, but now we have tests that assert it.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

Specify the platform(s) on which this was tested:

  • Debian Linux

@AndrewSisley AndrewSisley added area/query Related to the query component area/testing Related to any test or testing suite action/no-benchmark Skips the action that runs the benchmark. labels Jun 21, 2022
@AndrewSisley AndrewSisley requested a review from a team June 21, 2022 15:17
@AndrewSisley AndrewSisley self-assigned this Jun 21, 2022
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.

Approving assuming you apply the small suggested changes.

@@ -457,3 +457,89 @@ func TestQuerySimpleWithGroupByBooleanThenNumber(t *testing.T) {

executeTestCase(t, test)
}

func TestQuerySimpleWithGroupByNumberOnundefined(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
func TestQuerySimpleWithGroupByNumberOnundefined(t *testing.T) {
func TestQuerySimpleWithGroupByNumberOnUndefined(t *testing.T) {

Copy link
Contributor Author

@AndrewSisley AndrewSisley Jun 21, 2022

Choose a reason for hiding this comment

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

my bad, these were sloppy - thanks Fred

  • sort out typos/copy-pasta

executeTestCase(t, test)
}

func TestQuerySimpleWithGroupByNumberOnundefinedWithChildren(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
func TestQuerySimpleWithGroupByNumberOnundefinedWithChildren(t *testing.T) {
func TestQuerySimpleWithGroupByNumberOnUndefinedWithChildren(t *testing.T) {


func TestQuerySimpleWithGroupByNumberOnundefinedWithChildren(t *testing.T) {
test := testUtils.QueryTestCase{
Description: "Simple query with group by number, no children, undefined group value",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Description: "Simple query with group by number, no children, undefined group value",
Description: "Simple query with group by number, with children, undefined group value",

@AndrewSisley AndrewSisley force-pushed the sisley/test/I409-group-by-nil branch from 52e088a to 8bfa6c8 Compare June 21, 2022 16:12
@AndrewSisley AndrewSisley merged commit 78ab2fd into develop Jun 21, 2022
@AndrewSisley AndrewSisley deleted the sisley/test/I409-group-by-nil branch June 21, 2022 16:18
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/query Related to the query component area/testing Related to any test or testing suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GroupBy of nil properties is untested
2 participants