From 10bbbbbfaee1abef8add6785239cefaafb752bb6 Mon Sep 17 00:00:00 2001 From: Shahzad Lone Date: Thu, 8 Jun 2023 11:59:27 -0400 Subject: [PATCH] PR(TEST): Add group tests --- tests/integration/explain/debug/group_test.go | 86 ++++++++++ .../explain/debug/group_with_average_test.go | 157 ++++++++++++++++++ .../debug/group_with_dockey_child_test.go | 47 ++++++ .../explain/debug/group_with_dockey_test.go | 82 +++++++++ .../debug/group_with_filter_child_test.go | 75 +++++++++ .../explain/debug/group_with_filter_test.go | 48 ++++++ .../debug/group_with_limit_child_test.go | 75 +++++++++ .../explain/debug/group_with_limit_test.go | 95 +++++++++++ .../debug/group_with_order_child_test.go | 105 ++++++++++++ .../explain/debug/group_with_order_test.go | 124 ++++++++++++++ 10 files changed, 894 insertions(+) create mode 100644 tests/integration/explain/debug/group_test.go create mode 100644 tests/integration/explain/debug/group_with_average_test.go create mode 100644 tests/integration/explain/debug/group_with_dockey_child_test.go create mode 100644 tests/integration/explain/debug/group_with_dockey_test.go create mode 100644 tests/integration/explain/debug/group_with_filter_child_test.go create mode 100644 tests/integration/explain/debug/group_with_filter_test.go create mode 100644 tests/integration/explain/debug/group_with_limit_child_test.go create mode 100644 tests/integration/explain/debug/group_with_limit_test.go create mode 100644 tests/integration/explain/debug/group_with_order_child_test.go create mode 100644 tests/integration/explain/debug/group_with_order_test.go diff --git a/tests/integration/explain/debug/group_test.go b/tests/integration/explain/debug/group_test.go new file mode 100644 index 0000000000..af738627b8 --- /dev/null +++ b/tests/integration/explain/debug/group_test.go @@ -0,0 +1,86 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +var groupPattern = dataMap{ + "explain": dataMap{ + "selectTopNode": dataMap{ + "groupNode": dataMap{ + "selectNode": dataMap{ + "pipeNode": dataMap{ + "scanNode": dataMap{}, + }, + }, + }, + }, + }, +} + +func TestDebugExplainRequestWithGroupByOnParent(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with group-by on parent.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author (groupBy: [age]) { + age + _group { + name + } + } + }`, + + ExpectedFullGraph: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithGroupByTwoFieldsOnParent(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with group-by two fields on parent.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author (groupBy: [age, name]) { + age + _group { + name + } + } + }`, + + ExpectedFullGraph: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} diff --git a/tests/integration/explain/debug/group_with_average_test.go b/tests/integration/explain/debug/group_with_average_test.go new file mode 100644 index 0000000000..e001c1a529 --- /dev/null +++ b/tests/integration/explain/debug/group_with_average_test.go @@ -0,0 +1,157 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +var debugGroupAveragePattern = dataMap{ + "explain": dataMap{ + "selectTopNode": dataMap{ + "averageNode": dataMap{ + "countNode": dataMap{ + "sumNode": dataMap{ + "groupNode": dataMap{ + "selectNode": dataMap{ + "pipeNode": dataMap{ + "scanNode": dataMap{}, + }, + }, + }, + }, + }, + }, + }, + }, +} + +func TestDebugExplainRequestWithGroupByWithAverageOnAnInnerField(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with group-by with average on inner field.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author (groupBy: [name]) { + name + _avg(_group: {field: age}) + } + }`, + + ExpectedPatterns: []dataMap{debugGroupAveragePattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithAverageInsideTheInnerGroupOnAField(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with group-by with average of the inner _group on a field.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author (groupBy: [name]) { + name + _avg(_group: {field: _avg}) + _group(groupBy: [verified]) { + verified + _avg(_group: {field: age}) + } + } + }`, + + ExpectedPatterns: []dataMap{debugGroupAveragePattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithAverageInsideTheInnerGroupOnAFieldAndNestedGroupBy(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with group-by with average of the inner _group on a field and nested group-by.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author (groupBy: [name]) { + name + _avg(_group: {field: _avg}) + _group(groupBy: [verified]) { + verified + _avg(_group: {field: age}) + _group (groupBy: [age]){ + age + } + } + } + }`, + + ExpectedPatterns: []dataMap{debugGroupAveragePattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithAverageInsideTheInnerGroupAndNestedGroupByWithAverage(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with average inside the inner _group and nested groupBy with average.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author (groupBy: [name]) { + name + _avg(_group: {field: _avg}) + _group(groupBy: [verified]) { + verified + _avg(_group: {field: age}) + _group (groupBy: [age]){ + age + _avg(_group: {field: age}) + } + } + } + }`, + + ExpectedPatterns: []dataMap{debugGroupAveragePattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} diff --git a/tests/integration/explain/debug/group_with_dockey_child_test.go b/tests/integration/explain/debug/group_with_dockey_child_test.go new file mode 100644 index 0000000000..bc6555b961 --- /dev/null +++ b/tests/integration/explain/debug/group_with_dockey_child_test.go @@ -0,0 +1,47 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +func TestDebugExplainRequestWithDockeysOnInnerGroupSelection(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with dockeys on inner _group.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author( + groupBy: [age] + ) { + age + _group(dockeys: ["bae-6a4c5bc5-b044-5a03-a868-8260af6f2254"]) { + name + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} diff --git a/tests/integration/explain/debug/group_with_dockey_test.go b/tests/integration/explain/debug/group_with_dockey_test.go new file mode 100644 index 0000000000..fc53731c6a --- /dev/null +++ b/tests/integration/explain/debug/group_with_dockey_test.go @@ -0,0 +1,82 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +func TestDebugExplainRequestWithDockeyOnParentGroupBy(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with a dockey on parent groupBy.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author( + groupBy: [age], + dockey: "bae-6a4c5bc5-b044-5a03-a868-8260af6f2254" + ) { + age + _group { + name + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithDockeysAndFilterOnParentGroupBy(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with dockeys and filter on parent groupBy.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author( + groupBy: [age], + filter: {age: {_eq: 20}}, + dockeys: [ + "bae-6a4c5bc5-b044-5a03-a868-8260af6f2254", + "bae-4ea9d148-13f3-5a48-a0ef-9ffd344caeed" + ] + ) { + age + _group { + name + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} diff --git a/tests/integration/explain/debug/group_with_filter_child_test.go b/tests/integration/explain/debug/group_with_filter_child_test.go new file mode 100644 index 0000000000..61a8a72f3e --- /dev/null +++ b/tests/integration/explain/debug/group_with_filter_child_test.go @@ -0,0 +1,75 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +func TestDebugExplainRequestWithFilterOnInnerGroupSelection(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with filter on the inner _group selection.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author (groupBy: [age]) { + age + _group(filter: {age: {_gt: 63}}) { + name + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithFilterOnParentGroupByAndInnerGroupSelection(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with filter on parent groupBy and on the inner _group selection.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author ( + groupBy: [age], + filter: {age: {_gt: 62}} + ) { + age + _group(filter: {age: {_gt: 63}}) { + name + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} diff --git a/tests/integration/explain/debug/group_with_filter_test.go b/tests/integration/explain/debug/group_with_filter_test.go new file mode 100644 index 0000000000..b55d798c3a --- /dev/null +++ b/tests/integration/explain/debug/group_with_filter_test.go @@ -0,0 +1,48 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +func TestDebugExplainRequestWithFilterOnGroupByParent(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with filter on parent groupBy.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author ( + groupBy: [age], + filter: {age: {_gt: 63}} + ) { + age + _group { + name + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} diff --git a/tests/integration/explain/debug/group_with_limit_child_test.go b/tests/integration/explain/debug/group_with_limit_child_test.go new file mode 100644 index 0000000000..335c8866f0 --- /dev/null +++ b/tests/integration/explain/debug/group_with_limit_child_test.go @@ -0,0 +1,75 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +func TestDebugExplainRequestWithLimitAndOffsetOnInnerGroupSelection(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with limit and offset on inner _group selection.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author(groupBy: [name]) { + name + _group(limit: 2, offset: 1) { + age + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithLimitAndOffsetOnMultipleInnerGroupSelections(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with limit and offset on multiple inner _group selections.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author(groupBy: [name]) { + name + innerFirstGroup: _group(limit: 1, offset: 2) { + age + } + innerSecondGroup: _group(limit: 2) { + age + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} diff --git a/tests/integration/explain/debug/group_with_limit_test.go b/tests/integration/explain/debug/group_with_limit_test.go new file mode 100644 index 0000000000..82c84969fc --- /dev/null +++ b/tests/integration/explain/debug/group_with_limit_test.go @@ -0,0 +1,95 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +var debugGroupLimitPattern = dataMap{ + "explain": dataMap{ + "selectTopNode": dataMap{ + "limitNode": dataMap{ + "groupNode": dataMap{ + "selectNode": dataMap{ + "pipeNode": dataMap{ + "scanNode": dataMap{}, + }, + }, + }, + }, + }, + }, +} + +func TestDebugExplainRequestWithLimitAndOffsetOnParentGroupBy(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with limit and offset on parent groupBy.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author( + groupBy: [name], + limit: 1, + offset: 1 + ) { + name + _group { + age + } + } + }`, + + ExpectedPatterns: []dataMap{debugGroupLimitPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithLimitOnParentGroupByAndInnerGroupSelection(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with limit and offset on parent groupBy and inner _group selection.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author( + groupBy: [name], + limit: 1 + ) { + name + _group(limit: 2) { + age + } + } + }`, + + ExpectedPatterns: []dataMap{debugGroupLimitPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} diff --git a/tests/integration/explain/debug/group_with_order_child_test.go b/tests/integration/explain/debug/group_with_order_child_test.go new file mode 100644 index 0000000000..19d97424dc --- /dev/null +++ b/tests/integration/explain/debug/group_with_order_child_test.go @@ -0,0 +1,105 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +func TestDebugExplainRequestWithDescendingOrderOnInnerGroupSelection(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with order (descending) on inner _group selection.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author(groupBy: [name]) { + name + _group (order: {age: DESC}){ + age + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithAscendingOrderOnInnerGroupSelection(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with order (ascending) on inner _group selection.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author(groupBy: [name]) { + name + _group (order: {age: ASC}){ + age + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithOrderOnNestedParentGroupByAndOnNestedParentsInnerGroupSelection(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with order on nested parent groupBy and on nested parent's inner _group.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author(groupBy: [name]) { + name + _group ( + groupBy: [verified], + order: {verified: ASC} + ){ + verified + _group (order: {age: DESC}) { + age + } + } + } + }`, + + ExpectedPatterns: []dataMap{groupPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} diff --git a/tests/integration/explain/debug/group_with_order_test.go b/tests/integration/explain/debug/group_with_order_test.go new file mode 100644 index 0000000000..a7e3b717b0 --- /dev/null +++ b/tests/integration/explain/debug/group_with_order_test.go @@ -0,0 +1,124 @@ +// Copyright 2023 Democratized Data Foundation +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package test_explain_debug + +import ( + "testing" + + testUtils "github.com/sourcenetwork/defradb/tests/integration" + explainUtils "github.com/sourcenetwork/defradb/tests/integration/explain" +) + +var debugGroupOrderPattern = dataMap{ + "explain": dataMap{ + "selectTopNode": dataMap{ + "orderNode": dataMap{ + "groupNode": dataMap{ + "selectNode": dataMap{ + "pipeNode": dataMap{ + "scanNode": dataMap{}, + }, + }, + }, + }, + }, + }, +} + +func TestDebugExplainRequestWithDescendingOrderOnParentGroupBy(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with order (descending) on parent groupBy.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author( + groupBy: [name], + order: {name: DESC} + ) { + name + _group { + age + } + } + }`, + + ExpectedPatterns: []dataMap{debugGroupOrderPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithAscendingOrderOnParentGroupBy(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with order (ascending) on parent groupBy.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author( + groupBy: [name], + order: {name: ASC} + ) { + name + _group { + age + } + } + }`, + + ExpectedPatterns: []dataMap{debugGroupOrderPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +} + +func TestDebugExplainRequestWithOrderOnParentGroupByAndOnInnerGroupSelection(t *testing.T) { + test := testUtils.TestCase{ + + Description: "Explain (debug) request with order on parent groupBy and inner _group selection.", + + Actions: []any{ + explainUtils.SchemaForExplainTests, + + testUtils.ExplainRequest{ + + Request: `query @explain(type: debug) { + Author( + groupBy: [name], + order: {name: DESC} + ) { + name + _group (order: {age: ASC}){ + age + } + } + }`, + + ExpectedPatterns: []dataMap{debugGroupOrderPattern}, + }, + }, + } + + explainUtils.ExecuteTestCase(t, test) +}