From 5b8f01037be173702b75c44a068ffecbcab31c7e Mon Sep 17 00:00:00 2001 From: noisersup Date: Wed, 23 Aug 2023 16:23:12 +0200 Subject: [PATCH 01/16] wip --- integration/aggregate_documents_compat_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/integration/aggregate_documents_compat_test.go b/integration/aggregate_documents_compat_test.go index 65042d630a7a..50c0bf84dc75 100644 --- a/integration/aggregate_documents_compat_test.go +++ b/integration/aggregate_documents_compat_test.go @@ -40,7 +40,6 @@ type aggregateStagesCompatTestCase struct { resultType compatTestCaseResultType // defaults to nonEmptyResult resultPushdown bool // defaults to false skip string // skip test for all handlers, must have issue number mentioned - failsForSQLite string // optional, if set, the case is expected to fail for SQLite due to given issue } // testAggregateStagesCompat tests aggregation stages compatibility test cases with all providers. @@ -106,10 +105,7 @@ func testAggregateStagesCompatWithProviders(tt *testing.T, providers shareddata. tt.Run(targetCollection.Name(), func(tt *testing.T) { tt.Helper() - var t testtb.TB = tt - if tc.failsForSQLite != "" { - t = setup.FailsForSQLite(tt, tc.failsForSQLite) - } + t := setup.FailsForSQLite(tt, "https://github.com/FerretDB/FerretDB/issues/3148") explainCommand := bson.D{{"explain", bson.D{ {"aggregate", targetCollection.Name()}, @@ -158,7 +154,7 @@ func testAggregateStagesCompatWithProviders(tt *testing.T, providers shareddata. }) } - if tc.failsForSQLite != "" && setup.IsSQLite(tt) { + if setup.IsSQLite(tt) { return } From bb116fb76049d434db4e379c0e02f605179a2332 Mon Sep 17 00:00:00 2001 From: noisersup Date: Wed, 23 Aug 2023 16:26:21 +0200 Subject: [PATCH 02/16] wip --- .../aggregate_documents_compat_test.go | 599 +++++------------- 1 file changed, 151 insertions(+), 448 deletions(-) diff --git a/integration/aggregate_documents_compat_test.go b/integration/aggregate_documents_compat_test.go index 50c0bf84dc75..275d24166c8e 100644 --- a/integration/aggregate_documents_compat_test.go +++ b/integration/aggregate_documents_compat_test.go @@ -273,32 +273,28 @@ func TestAggregateCommandCompat(t *testing.T) { command: bson.D{ {"aggregate", 2}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "PipelineTypeMismatch": { command: bson.D{ {"aggregate", "collection-name"}, {"pipeline", 1}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "StageTypeMismatch": { command: bson.D{ {"aggregate", "collection-name"}, {"pipeline", bson.A{1}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidStage": { command: bson.D{ {"aggregate", "collection-name"}, {"pipeline", bson.A{"$invalid-stage"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "MaxTimeMSDoubleWholeNumber": { command: bson.D{ @@ -307,7 +303,6 @@ func TestAggregateCommandCompat(t *testing.T) { {"cursor", bson.D{}}, {"maxTimeMS", float64(1000)}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } @@ -324,14 +319,12 @@ func TestAggregateCompatOptions(t *testing.T) { testCases := map[string]aggregateStagesCompatTestCase{ "MaxTimeZero": { - pipeline: bson.A{}, - maxTime: pointer.ToDuration(time.Duration(0)), - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{}, + maxTime: pointer.ToDuration(time.Duration(0)), }, "MaxTime": { - pipeline: bson.A{}, - maxTime: pointer.ToDuration(time.Second), - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{}, + maxTime: pointer.ToDuration(time.Second), }, } @@ -350,7 +343,6 @@ func TestAggregateCompatStages(t *testing.T) { bson.D{{"$sort", bson.D{{"_id", 1}}}}, }, resultPushdown: true, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "CountAndMatch": { pipeline: bson.A{ @@ -359,7 +351,6 @@ func TestAggregateCompatStages(t *testing.T) { bson.D{{"$match", bson.D{{"v", 1}}}}, bson.D{{"$sort", bson.D{{"_id", 1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } @@ -377,8 +368,7 @@ func TestAggregateCompatEmptyPipeline(t *testing.T) { testCases := map[string]aggregateStagesCompatTestCase{ "Empty": { - pipeline: bson.A{}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{}, }, } @@ -390,37 +380,30 @@ func TestAggregateCompatCount(t *testing.T) { testCases := map[string]aggregateStagesCompatTestCase{ "Value": { - pipeline: bson.A{bson.D{{"$count", "v"}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$count", "v"}}}, }, "NonExistent": { - pipeline: bson.A{bson.D{{"$count", "nonexistent"}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$count", "nonexistent"}}}, }, "CountGroupID": { - pipeline: bson.A{bson.D{{"$count", "_id"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$count", "_id"}}}, + resultType: emptyResult, }, "CountNonString": { - pipeline: bson.A{bson.D{{"$count", 1}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$count", 1}}}, + resultType: emptyResult, }, "CountEmpty": { - pipeline: bson.A{bson.D{{"$count", ""}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$count", ""}}}, + resultType: emptyResult, }, "CountBadValue": { - pipeline: bson.A{bson.D{{"$count", "v.foo"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$count", "v.foo"}}}, + resultType: emptyResult, }, "CountBadPrefix": { - pipeline: bson.A{bson.D{{"$count", "$foo"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$count", "$foo"}}}, + resultType: emptyResult, }, } @@ -451,7 +434,6 @@ func TestAggregateCompatGroupDeterministicCollections(t *testing.T) { // sort descending order, so ArrayDoubles has deterministic order. bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Distinct": { pipeline: bson.A{ @@ -480,7 +462,6 @@ func TestAggregateCompatGroupDeterministicCollections(t *testing.T) { // sort descending order, so ArrayDoubles has deterministic order. bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "LimitAfter": { @@ -493,7 +474,6 @@ func TestAggregateCompatGroupDeterministicCollections(t *testing.T) { bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", 5}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "LimitBefore": { pipeline: bson.A{ @@ -505,7 +485,6 @@ func TestAggregateCompatGroupDeterministicCollections(t *testing.T) { // sort descending order, so ArrayDoubles has deterministic order. bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "SkipAfter": { pipeline: bson.A{ @@ -517,7 +496,6 @@ func TestAggregateCompatGroupDeterministicCollections(t *testing.T) { bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$skip", 2}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "SkipBefore": { pipeline: bson.A{ @@ -529,7 +507,6 @@ func TestAggregateCompatGroupDeterministicCollections(t *testing.T) { // sort descending order, so ArrayDoubles has deterministic order. bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } @@ -544,13 +521,11 @@ func TestAggregateCompatGroup(t *testing.T) { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", nil}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DistinctID": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$_id"}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IDExpression": { pipeline: bson.A{ @@ -560,7 +535,6 @@ func TestAggregateCompatGroup(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", 1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IDExpressionNested": { pipeline: bson.A{ @@ -673,61 +647,52 @@ func TestAggregateCompatGroup(t *testing.T) { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$invalid"}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NonExpressionID": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "v"}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NonStringID": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", bson.A{}}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "OperatorNameAsExpression": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$add"}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "EmptyPath": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$"}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "EmptyVariable": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$$"}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidVariable$": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$$$"}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidVariable$s": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$$$s"}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "NonExistingVariable": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$$s"}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - skip: "https://github.com/FerretDB/FerretDB/issues/2275", + resultType: emptyResult, + skip: "https://github.com/FerretDB/FerretDB/issues/2275", }, "SystemVariable": { pipeline: bson.A{bson.D{{"$group", bson.D{ @@ -737,45 +702,39 @@ func TestAggregateCompatGroup(t *testing.T) { skip: "https://github.com/FerretDB/FerretDB/issues/2275", }, "GroupInvalidFields": { - pipeline: bson.A{bson.D{{"$group", 1}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$group", 1}}}, + resultType: emptyResult, }, "EmptyGroup": { - pipeline: bson.A{bson.D{{"$group", bson.D{}}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$group", bson.D{}}}}, + resultType: emptyResult, }, "MissingID": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"bla", 1}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidAccumulator": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", nil}, {"v", 1}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "EmptyAccumulator": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", nil}, {"v", bson.D{}}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "GroupMultipleAccumulator": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", nil}, {"v", bson.D{{"$count", "v"}, {"$count", "v"}}}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "GroupInvalidAccumulator": { pipeline: bson.A{bson.D{{"$group", bson.D{ @@ -790,7 +749,6 @@ func TestAggregateCompatGroup(t *testing.T) { {"_id", bson.D{{"$type", "$v"}}}, {"count", bson.D{{"$count", bson.D{}}}}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IDSum": { pipeline: bson.A{ @@ -798,7 +756,6 @@ func TestAggregateCompatGroup(t *testing.T) { bson.D{{"$group", bson.D{{"_id", bson.D{{"$sum", "$v"}}}}}}, bson.D{{"$sort", bson.D{{"_id", 1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IDFieldSum": { pipeline: bson.A{ @@ -820,21 +777,18 @@ func TestAggregateCompatGroup(t *testing.T) { bson.D{{"$group", bson.D{{"_id", bson.D{{"$sum", "$non-existent"}}}}}}, bson.D{{"$sort", bson.D{{"_id", 1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IDSumInvalid": { pipeline: bson.A{ bson.D{{"$group", bson.D{{"_id", bson.D{{"$sum", "$"}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "IDSumRecursiveInvalid": { pipeline: bson.A{ bson.D{{"$group", bson.D{{"_id", bson.D{{"$sum", bson.D{{"$sum", "$"}}}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, } @@ -858,37 +812,26 @@ func TestAggregateCompatGroupExpressionDottedFields(t *testing.T) { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$v.foo"}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DeeplyNested": { // Expect non-empty results for DocumentsDeeplyNested provider pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$v.a.b.c"}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ArrayIndex": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$v.0"}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NestedInArray": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$v.0.foo"}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - }, - "NonExistentParent": { - pipeline: bson.A{bson.D{{"$group", bson.D{ - {"_id", "$non.existent"}, - }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NonExistentChild": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$v.non.existent"}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } @@ -929,37 +872,32 @@ func TestAggregateCompatGroupCount(t *testing.T) { {"_id", nil}, {"count", bson.D{{"$count", bson.D{}}}}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "CountID": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$_id"}, {"count", bson.D{{"$count", bson.D{}}}}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeMismatch": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", nil}, {"count", bson.D{{"$count", ""}}}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "NonEmptyExpression": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", nil}, {"count", bson.D{{"$count", bson.D{{"a", 1}}}}}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "NonExistentField": { pipeline: bson.A{bson.D{{"$group", bson.D{ {"_id", "$nonexistent"}, {"count", bson.D{{"$count", bson.D{}}}}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Duplicate": { pipeline: bson.A{bson.D{{"$group", bson.D{ @@ -967,8 +905,7 @@ func TestAggregateCompatGroupCount(t *testing.T) { {"count", bson.D{{"$count", bson.D{}}}}, {"count", bson.D{{"$count", bson.D{}}}}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, } @@ -984,92 +921,80 @@ func TestAggregateCompatLimit(t *testing.T) { bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", 0}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "One": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", 1}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Five": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", 5}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "StringInt": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", "5"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Double": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", 4.5}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "DoubleInt": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", 5.0}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "MaxInt64": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", math.MaxInt64}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "MinInt64": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", math.MinInt64}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Negative": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", -1}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "NegativeDouble": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", -2.1}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Document": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", bson.D{}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Int64Overflow": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$limit", float64(1 << 86)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "AfterMatch": { pipeline: bson.A{ @@ -1078,7 +1003,6 @@ func TestAggregateCompatLimit(t *testing.T) { bson.D{{"$limit", 1}}, }, resultPushdown: true, // $sort and $match are first two stages - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "BeforeMatch": { pipeline: bson.A{ @@ -1086,8 +1010,7 @@ func TestAggregateCompatLimit(t *testing.T) { bson.D{{"$limit", 1}}, bson.D{{"$match", bson.D{{"v", "foo"}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "NoSortAfterMatch": { pipeline: bson.A{ @@ -1095,14 +1018,12 @@ func TestAggregateCompatLimit(t *testing.T) { bson.D{{"$limit", 100}}, }, resultPushdown: true, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NoSortBeforeMatch": { pipeline: bson.A{ bson.D{{"$limit", 100}}, bson.D{{"$match", bson.D{{"v", "foo"}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } @@ -1139,7 +1060,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { // ascending sort for shareddata collections. bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "GroupByID": { pipeline: bson.A{ @@ -1150,7 +1070,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "GroupByValue": { pipeline: bson.A{ @@ -1161,7 +1080,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "EmptyString": { pipeline: bson.A{ @@ -1172,7 +1090,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NonExpression": { pipeline: bson.A{ @@ -1183,7 +1100,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NonExistent": { pipeline: bson.A{ @@ -1194,7 +1110,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Document": { pipeline: bson.A{ @@ -1206,7 +1121,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Array": { pipeline: bson.A{ @@ -1217,8 +1131,7 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Int32": { pipeline: bson.A{ @@ -1229,7 +1142,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "MaxInt32": { pipeline: bson.A{ @@ -1240,7 +1152,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NegativeInt32": { pipeline: bson.A{ @@ -1251,7 +1162,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Int64": { pipeline: bson.A{ @@ -1262,18 +1172,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - }, - "MaxInt64": { - pipeline: bson.A{ - bson.D{{"$sort", bson.D{{"_id", 1}}}}, - bson.D{{"$group", bson.D{ - {"_id", "$v"}, - {"sum", bson.D{{"$sum", math.MaxInt64}}}, - }}}, - bson.D{{"$sort", bson.D{{"_id", -1}}}}, - }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Double": { pipeline: bson.A{ @@ -1284,7 +1182,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "MaxDouble": { pipeline: bson.A{ @@ -1295,7 +1192,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Bool": { pipeline: bson.A{ @@ -1306,7 +1202,6 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Duplicate": { pipeline: bson.A{ @@ -1318,8 +1213,7 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "RecursiveOperator": { pipeline: bson.A{ @@ -1331,21 +1225,18 @@ func TestAggregateCompatGroupSum(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "RecursiveInvalid": { pipeline: bson.A{ bson.D{{"$group", bson.D{{"sum", bson.D{{"$sum", bson.D{{"v", "$v"}}}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "RecursiveArrayInvalid": { pipeline: bson.A{ bson.D{{"$group", bson.D{{"sum", bson.D{{"$sum", bson.D{{"$type", bson.A{"1", "2"}}}}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "RecursiveOperatorNonExistent": { pipeline: bson.A{ @@ -1355,8 +1246,7 @@ func TestAggregateCompatGroupSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.D{{"$non-existent", "$v"}}}}}, }}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, } @@ -1373,56 +1263,46 @@ func TestAggregateCompatMatch(t *testing.T) { "ID": { pipeline: bson.A{bson.D{{"$match", bson.D{{"_id", "string"}}}}}, resultPushdown: true, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Int": { pipeline: bson.A{ bson.D{{"$match", bson.D{{"v", 42}}}}, }, resultPushdown: true, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "String": { pipeline: bson.A{ bson.D{{"$match", bson.D{{"v", "foo"}}}}, }, resultPushdown: true, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Document": { - pipeline: bson.A{bson.D{{"$match", bson.D{{"v", bson.D{{"foo", int32(42)}}}}}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$match", bson.D{{"v", bson.D{{"foo", int32(42)}}}}}}}, }, "Array": { - pipeline: bson.A{bson.D{{"$match", bson.D{{"v", bson.A{int32(42)}}}}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$match", bson.D{{"v", bson.A{int32(42)}}}}}}, }, "Regex": { - pipeline: bson.A{bson.D{{"$match", bson.D{{"v", bson.D{{"$eq", primitive.Regex{Pattern: "foo", Options: "i"}}}}}}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$match", bson.D{{"v", bson.D{{"$eq", primitive.Regex{Pattern: "foo", Options: "i"}}}}}}}}, }, "Empty": { pipeline: bson.A{ bson.D{{"$match", bson.D{}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationDocument": { pipeline: bson.A{ bson.D{{"$match", bson.D{{"v.foo", int32(42)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationArray": { pipeline: bson.A{ bson.D{{"$match", bson.D{{"v.0", int32(42)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "MatchBadValue": { - pipeline: bson.A{bson.D{{"$match", 1}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$match", 1}}}, + resultType: emptyResult, }, "SumValue": { pipeline: bson.A{ @@ -1440,40 +1320,34 @@ func TestAggregateCompatSort(t *testing.T) { testCases := map[string]aggregateStagesCompatTestCase{ "AscendingID": { - pipeline: bson.A{bson.D{{"$sort", bson.D{{"_id", 1}}}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$sort", bson.D{{"_id", 1}}}}}, }, "DescendingID": { - pipeline: bson.A{bson.D{{"$sort", bson.D{{"_id", -1}}}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$sort", bson.D{{"_id", -1}}}}}, }, "AscendingValue": { pipeline: bson.A{bson.D{{"$sort", bson.D{ {"v", 1}, {"_id", 1}, // sort by _id when v is the same. }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DescendingValue": { pipeline: bson.A{bson.D{{"$sort", bson.D{ {"v", -1}, {"_id", 1}, // sort by _id when v is the same. }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "AscendingValueDescendingID": { pipeline: bson.A{bson.D{{"$sort", bson.D{ {"v", 1}, {"_id", -1}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DescendingValueDescendingID": { pipeline: bson.A{bson.D{{"$sort", bson.D{ {"v", -1}, {"_id", -1}, }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationIndex": { @@ -1481,42 +1355,35 @@ func TestAggregateCompatSort(t *testing.T) { {"v.0", 1}, {"_id", 1}, // sort by _id when v is the same. }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationNonExistent": { pipeline: bson.A{bson.D{{"$sort", bson.D{ {"invalid.foo", 1}, {"_id", 1}, // sort by _id when v is the same. }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationMissingField": { pipeline: bson.A{bson.D{{"$sort", bson.D{ {"v..foo", 1}, }}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "SortBadExpression": { - pipeline: bson.A{bson.D{{"$sort", 1}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$sort", 1}}}, + resultType: emptyResult, }, "SortBadOrder": { - pipeline: bson.A{bson.D{{"$sort", bson.D{{"_id", 0}}}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$sort", bson.D{{"_id", 0}}}}}, + resultType: emptyResult, }, "SortMissingKey": { - pipeline: bson.A{bson.D{{"$sort", bson.D{}}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$sort", bson.D{}}}}, + resultType: emptyResult, }, "BadDollarStart": { - pipeline: bson.A{bson.D{{"$sort", bson.D{{"$v.foo", 1}}}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$sort", bson.D{{"$v.foo", 1}}}}}, + resultType: emptyResult, }, } @@ -1536,7 +1403,6 @@ func TestAggregateCompatSortDotNotation(t *testing.T) { {"v.foo", 1}, {"_id", 1}, // sort by _id when v is the same. }}}}, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } @@ -1552,116 +1418,97 @@ func TestAggregateCompatUnwind(t *testing.T) { bson.D{{"$sort", bson.D{{"_id", 1}}}}, bson.D{{"$unwind", "$v"}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NonExistent": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", 1}}}}, bson.D{{"$unwind", "$non-existent"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Invalid": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", 1}}}}, bson.D{{"$unwind", "invalid"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "DotNotation": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", 1}}}}, bson.D{{"$unwind", "$v.foo"}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationNonExistent": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", 1}}}}, bson.D{{"$unwind", "$v.non-existent"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "ArrayDotNotation": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", 1}}}}, bson.D{{"$unwind", "$v.0"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "ArrayDotNotationKey": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", 1}}}}, bson.D{{"$unwind", "$v.0.foo"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Null": { - pipeline: bson.A{bson.D{{"$unwind", nil}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", nil}}}, + resultType: emptyResult, }, "ID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", 1}}}}, bson.D{{"$unwind", "$_id"}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "NameAsExpression": { - pipeline: bson.A{bson.D{{"$unwind", "$add"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", "$add"}}}, + resultType: emptyResult, }, "EmptyPath": { - pipeline: bson.A{bson.D{{"$unwind", "$"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", "$"}}}, + resultType: emptyResult, }, "EmptyVariable": { - pipeline: bson.A{bson.D{{"$unwind", "$$"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", "$$"}}}, + resultType: emptyResult, }, "InvalidVariable$": { - pipeline: bson.A{bson.D{{"$unwind", "$$$"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", "$$$"}}}, + resultType: emptyResult, }, "InvalidVariable$s": { - pipeline: bson.A{bson.D{{"$unwind", "$$$s"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", "$$$s"}}}, + resultType: emptyResult, }, "NonExistingVariable": { - pipeline: bson.A{bson.D{{"$unwind", "$$s"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", "$$s"}}}, + resultType: emptyResult, }, "SystemVariable": { - pipeline: bson.A{bson.D{{"$unwind", "$$NOW"}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", "$$NOW"}}}, + resultType: emptyResult, }, "Empty": { - pipeline: bson.A{bson.D{{"$unwind", ""}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", ""}}}, + resultType: emptyResult, }, "Number": { - pipeline: bson.A{bson.D{{"$unwind", 42}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", 42}}}, + resultType: emptyResult, }, "Array": { - pipeline: bson.A{bson.D{{"$unwind", bson.A{"$v"}}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$unwind", bson.A{"$v"}}}}, + resultType: emptyResult, }, } @@ -1673,73 +1520,63 @@ func TestAggregateCompatSkip(t *testing.T) { testCases := map[string]aggregateStagesCompatTestCase{ "Document": { - pipeline: bson.A{bson.D{{"$skip", bson.D{}}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$skip", bson.D{}}}}, + resultType: emptyResult, }, "Zero": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$skip", int32(0)}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "One": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$skip", int32(1)}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "SkipAll": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$skip", int32(1000)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "StringInt": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$skip", "1"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "NegativeValue": { - pipeline: bson.A{bson.D{{"$skip", int32(-1)}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$skip", int32(-1)}}}, + resultType: emptyResult, }, "NegativeDouble": { - pipeline: bson.A{bson.D{{"$skip", -3.2}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + pipeline: bson.A{bson.D{{"$skip", -3.2}}}, + resultType: emptyResult, }, "MaxInt64": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$skip", math.MaxInt64}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "MinInt64": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$skip", math.MinInt64}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Int64Overflow": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$skip", float64(1 << 86)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "AfterMatch": { pipeline: bson.A{ @@ -1748,7 +1585,6 @@ func TestAggregateCompatSkip(t *testing.T) { bson.D{{"$skip", int32(1)}}, }, resultPushdown: true, // $match after $sort can be pushed down - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "BeforeMatch": { pipeline: bson.A{ @@ -1756,7 +1592,6 @@ func TestAggregateCompatSkip(t *testing.T) { bson.D{{"$skip", int32(1)}}, bson.D{{"$match", bson.D{{"v", "foo"}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } @@ -1772,67 +1607,58 @@ func TestAggregateCompatProject(t *testing.T) { bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", "invalid"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "ZeroOperators": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"v", bson.D{}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "TwoOperators": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"v", bson.D{{"$type", "foo"}, {"$sum", 1}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "DollarSignField": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"$v", 1}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Include1Field": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"v", int32(1)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Exclude1Field": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"v", int64(0)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IncludeID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", 1.42}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ExcludeID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", false}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Include2Fields": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"foo", 1.24}, {"bar", true}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Exclude2Fields": { pipeline: bson.A{ @@ -1840,7 +1666,6 @@ func TestAggregateCompatProject(t *testing.T) { bson.D{{"$project", bson.D{{"foo", int32(0)}, {"bar", false}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Include1FieldExclude1Field": { pipeline: bson.A{ @@ -1848,8 +1673,7 @@ func TestAggregateCompatProject(t *testing.T) { bson.D{{"$project", bson.D{{"foo", int32(0)}, {"bar", true}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Exclude1FieldInclude1Field": { pipeline: bson.A{ @@ -1857,71 +1681,61 @@ func TestAggregateCompatProject(t *testing.T) { bson.D{{"$project", bson.D{{"foo", int32(1)}, {"bar", false}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "IncludeFieldExcludeID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", false}, {"v", true}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ExcludeFieldIncludeID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", true}, {"v", false}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ExcludeFieldExcludeID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", false}, {"v", false}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IncludeFieldIncludeID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", true}, {"v", true}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Assign1Field": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"foo", primitive.NewObjectID()}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "AssignID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", primitive.Binary{Subtype: 0x80, Data: []byte{42, 0, 13}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Assign1FieldIncludeID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", true}, {"foo", primitive.NewDateTimeFromTime(time.Unix(0, 0))}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Assign2FieldsIncludeID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", true}, {"foo", nil}, {"bar", "qux"}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Assign1FieldExcludeID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", false}, {"foo", primitive.Regex{Pattern: "^fo"}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationInclude": { pipeline: bson.A{ @@ -1930,7 +1744,6 @@ func TestAggregateCompatProject(t *testing.T) { {"v.foo", true}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationIncludeTwo": { pipeline: bson.A{ @@ -1940,7 +1753,6 @@ func TestAggregateCompatProject(t *testing.T) { {"v.array", true}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationExclude": { pipeline: bson.A{ @@ -1949,7 +1761,6 @@ func TestAggregateCompatProject(t *testing.T) { {"v.foo", false}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationExcludeTwo": { pipeline: bson.A{ @@ -1959,7 +1770,6 @@ func TestAggregateCompatProject(t *testing.T) { {"v.array", false}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationExcludeSecondLevel": { pipeline: bson.A{ @@ -1968,7 +1778,6 @@ func TestAggregateCompatProject(t *testing.T) { {"v.array.42", false}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationIncludeExclude": { pipeline: bson.A{ @@ -1978,37 +1787,32 @@ func TestAggregateCompatProject(t *testing.T) { {"v.array.42", false}, }}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "EmptyDocument": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"foo", bson.D{}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Document": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"foo", bson.D{{"v", "foo"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IDDocument": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", bson.D{{"v", "foo"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IDType": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"_id", bson.D{{"$type", "$v"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DocumentAndValue": { pipeline: bson.A{ @@ -2018,58 +1822,50 @@ func TestAggregateCompatProject(t *testing.T) { {"v", 1}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Type": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", "$v"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeNonExistent": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", "$foo"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeDotNotation": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", "$v.foo"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeRecursive": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", bson.D{{"$type", "$v"}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeRecursiveNonExistent": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", bson.D{{"$non-existent", "$v"}}}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "TypeRecursiveInvalid": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", bson.D{{"v", "$v"}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeRecursiveArrayInvalid": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", bson.D{{"$type", bson.A{"1", "2"}}}}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "TypeInt": { @@ -2077,79 +1873,68 @@ func TestAggregateCompatProject(t *testing.T) { bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", int32(42)}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeLong": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", int64(42)}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeString": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", "42"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeDocument": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", bson.D{{"foo", "bar"}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeEmpty": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", bson.D{}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeArraySingleItem": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", bson.A{int32(42)}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeArray": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", bson.A{"foo", "bar"}}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "TypeNestedArray": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", bson.A{bson.A{"foo", "bar"}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeObjectID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", primitive.NewObjectID()}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeBool": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"type", bson.D{{"$type", true}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ProjectManyOperators": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$project", bson.D{{"$type", "foo"}, {"$op", "foo"}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, } @@ -2166,7 +1951,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", "$v"}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotation": { pipeline: bson.A{ @@ -2174,7 +1958,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", "$v.foo"}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ArrayDotNotation": { pipeline: bson.A{ @@ -2182,7 +1965,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", "$v.0.foo"}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Int": { pipeline: bson.A{ @@ -2190,7 +1972,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", int32(2)}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Long": { pipeline: bson.A{ @@ -2198,7 +1979,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", int64(3)}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Double": { pipeline: bson.A{ @@ -2206,7 +1986,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", float64(4)}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "EmptyString": { pipeline: bson.A{ @@ -2214,7 +1993,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", ""}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ArrayEmptyVariable": { pipeline: bson.A{ @@ -2222,8 +2000,7 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.A{"$"}}}}, }}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "ArrayValue": { pipeline: bson.A{ @@ -2231,7 +2008,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.A{"$v"}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ArrayTwoValues": { pipeline: bson.A{ @@ -2239,7 +2015,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.A{"$v", "$v"}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ArrayValueInt": { pipeline: bson.A{ @@ -2247,7 +2022,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.A{"$v", int32(1)}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ArrayIntLongDoubleStringBool": { pipeline: bson.A{ @@ -2255,7 +2029,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.A{int32(2), int64(3), float64(4), "not-expression", true}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "RecursiveValue": { pipeline: bson.A{ @@ -2263,7 +2036,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sumsum", bson.D{{"$sum", bson.D{{"$sum", "$v"}}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "RecursiveArrayValue": { pipeline: bson.A{ @@ -2271,7 +2043,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sumsum", bson.D{{"$sum", bson.D{{"$sum", bson.A{"$v"}}}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ArrayValueRecursiveInt": { pipeline: bson.A{ @@ -2279,7 +2050,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.A{"$v", bson.D{{"$sum", int32(2)}}}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ArrayValueAndRecursiveValue": { pipeline: bson.A{ @@ -2287,7 +2057,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.A{"$v", bson.D{{"$sum", "$v"}}}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ArrayValueAndRecursiveArray": { pipeline: bson.A{ @@ -2295,7 +2064,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.A{"$v", bson.D{{"$sum", bson.A{"$v"}}}}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Type": { pipeline: bson.A{ @@ -2303,7 +2071,6 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sumtype", bson.D{{"$sum", bson.D{{"$type", "$v"}}}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "RecursiveEmptyVariable": { pipeline: bson.A{ @@ -2311,8 +2078,7 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.D{{"$sum", "$$$"}}}}}, }}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "MultipleRecursiveEmptyVariable": { pipeline: bson.A{ @@ -2320,8 +2086,7 @@ func TestAggregateCompatProjectSum(t *testing.T) { {"sum", bson.D{{"$sum", bson.D{{"$sum", bson.D{{"$sum", "$$$"}}}}}}}, }}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, } @@ -2336,94 +2101,80 @@ func TestAggregateCompatAddFields(t *testing.T) { pipeline: bson.A{ bson.D{{"$addFields", "invalid"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeBool": { pipeline: bson.A{ bson.D{{"$addFields", false}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeArray": { pipeline: bson.A{ bson.D{{"$addFields", bson.A{}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeInt32": { pipeline: bson.A{ bson.D{{"$addFields", int32(1)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeInt64": { pipeline: bson.A{ bson.D{{"$addFields", int64(1)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeFloat32": { pipeline: bson.A{ bson.D{{"$addFields", float32(1)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeFloat64": { pipeline: bson.A{ bson.D{{"$addFields", float64(1)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeNull": { pipeline: bson.A{ bson.D{{"$addFields", nil}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Include1Field": { pipeline: bson.A{ bson.D{{"$addFields", bson.D{{"newField", int32(1)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Include2Fields": { pipeline: bson.A{ bson.D{{"$addFields", bson.D{{"newField1", int32(1)}, {"newField2", int32(2)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Include2Stages": { pipeline: bson.A{ bson.D{{"$addFields", bson.D{{"newField1", int32(1)}}}}, bson.D{{"$addFields", bson.D{{"newField2", int32(2)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IncludeDocument": { pipeline: bson.A{ bson.D{{"$addFields", bson.D{{"newField", bson.D{{"doc", int32(1)}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IncludeNestedDocument": { pipeline: bson.A{ bson.D{{"$addFields", bson.D{{"newField", bson.D{{"doc", bson.D{{"nested", int32(1)}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IncludeArray": { pipeline: bson.A{ bson.D{{"$addFields", bson.D{{"newField", bson.A{bson.D{{"elem", int32(1)}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "UnsupportedExpressionObject": { pipeline: bson.A{ @@ -2445,51 +2196,44 @@ func TestAggregateCompatAddFields(t *testing.T) { bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"value", bson.D{{"$invalid-operator", "foo"}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Type": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", "$v"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeNonExistent": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", "$foo"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeDotNotation": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", "$v.foo"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeRecursive": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", bson.D{{"$type", "$v"}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeRecursiveNonExistent": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", bson.D{{"$non-existent", "$v"}}}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "TypeRecursiveInvalid": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", bson.D{{"v", "$v"}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeInt": { @@ -2497,95 +2241,82 @@ func TestAggregateCompatAddFields(t *testing.T) { bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", int32(42)}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeLong": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", int64(42)}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeString": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", "42"}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeDocument": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", bson.D{{"foo", "bar"}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeEmpty": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", bson.D{}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "MultipleOperators": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", "foo"}, {"$operator", "foo"}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "MultipleOperatorFirst": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", "foo"}, {"not-operator", "foo"}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "MultipleOperatorLast": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"not-operator", "foo"}, {"$type", "foo"}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "TypeArraySingleItem": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", bson.A{int32(42)}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeArray": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", bson.A{"foo", "bar"}}}}}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "TypeNestedArray": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", bson.A{bson.A{"foo", "bar"}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeObjectID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", primitive.NewObjectID()}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "TypeBool": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", -1}}}}, bson.D{{"$addFields", bson.D{{"type", bson.D{{"$type", true}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "SumValue": { pipeline: bson.A{ @@ -2593,7 +2324,6 @@ func TestAggregateCompatAddFields(t *testing.T) { {"sum", bson.D{{"$sum", "$v"}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } @@ -2608,94 +2338,80 @@ func TestAggregateCompatSet(t *testing.T) { pipeline: bson.A{ bson.D{{"$set", "invalid"}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeBool": { pipeline: bson.A{ bson.D{{"$set", false}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeArray": { pipeline: bson.A{ bson.D{{"$set", bson.A{}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeInt32": { pipeline: bson.A{ bson.D{{"$set", int32(1)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeInt64": { pipeline: bson.A{ bson.D{{"$set", int64(1)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeFloat32": { pipeline: bson.A{ bson.D{{"$set", float32(1)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeFloat64": { pipeline: bson.A{ bson.D{{"$set", float64(1)}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeNull": { pipeline: bson.A{ bson.D{{"$set", nil}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Include1Field": { pipeline: bson.A{ bson.D{{"$set", bson.D{{"newField", int32(1)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Include2Fields": { pipeline: bson.A{ bson.D{{"$set", bson.D{{"newField1", int32(1)}, {"newField2", int32(2)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Include2Stages": { pipeline: bson.A{ bson.D{{"$set", bson.D{{"newField1", int32(1)}}}}, bson.D{{"$set", bson.D{{"newField2", int32(2)}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IncludeDocument": { pipeline: bson.A{ bson.D{{"$set", bson.D{{"newField", bson.D{{"doc", int32(1)}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IncludeNestedDocument": { pipeline: bson.A{ bson.D{{"$set", bson.D{{"newField", bson.D{{"doc", bson.D{{"nested", int32(1)}}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "IncludeArray": { pipeline: bson.A{ bson.D{{"$set", bson.D{{"newField", bson.A{bson.D{{"elem", int32(1)}}}}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "UnsupportedExpressionObject": { pipeline: bson.A{ @@ -2717,7 +2433,6 @@ func TestAggregateCompatSet(t *testing.T) { {"sum", bson.D{{"$sum", "$v"}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } testAggregateStagesCompat(t, testCases) @@ -2731,80 +2446,68 @@ func TestAggregateCompatUnset(t *testing.T) { pipeline: bson.A{ bson.D{{"$unset", bson.A{1, 2, 3}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "EmptyArray": { pipeline: bson.A{ bson.D{{"$unset", bson.A{}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "EmptyString": { pipeline: bson.A{ bson.D{{"$unset", ""}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "ArrayWithEmptyString": { pipeline: bson.A{ bson.D{{"$unset", bson.A{""}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidTypeArrayWithDifferentTypes": { pipeline: bson.A{ bson.D{{"$unset", bson.A{"v", 42, false}}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "InvalidType": { pipeline: bson.A{ bson.D{{"$unset", false}}, }, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", + resultType: emptyResult, }, "Unset1Field": { pipeline: bson.A{ bson.D{{"$unset", "v"}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "UnsetID": { pipeline: bson.A{ bson.D{{"$sort", bson.D{{"_id", 1}}}}, bson.D{{"$unset", "_id"}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "Unset2Fields": { pipeline: bson.A{ bson.D{{"$unset", bson.A{"_id", "v"}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationUnset": { pipeline: bson.A{ bson.D{{"$unset", "v.foo"}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationUnsetTwo": { pipeline: bson.A{ bson.D{{"$unset", bson.A{"v.foo", "v.array"}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "DotNotationUnsetSecondLevel": { pipeline: bson.A{ bson.D{{"$unset", "v.array.42"}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, } testAggregateStagesCompat(t, testCases) From dca5c4008c34afa0cab1b7217c680056d1d964ab Mon Sep 17 00:00:00 2001 From: noisersup Date: Wed, 23 Aug 2023 16:26:59 +0200 Subject: [PATCH 03/16] wip --- .../aggregate_variables_compat_test.go | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/integration/aggregate_variables_compat_test.go b/integration/aggregate_variables_compat_test.go index f857526fce86..2a52ae389932 100644 --- a/integration/aggregate_variables_compat_test.go +++ b/integration/aggregate_variables_compat_test.go @@ -32,8 +32,7 @@ func TestAggregateVariablesCompatRoot(t *testing.T) { pipeline: bson.A{ bson.D{{"$addFields", bson.D{{"field", "$$ROOT"}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - skip: "https://github.com/FerretDB/FerretDB/issues/1413", + skip: "https://github.com/FerretDB/FerretDB/issues/1413", }, "GroupID": { pipeline: bson.A{ @@ -41,8 +40,7 @@ func TestAggregateVariablesCompatRoot(t *testing.T) { bson.D{{"$group", bson.D{{"_id", "$$ROOT"}}}}, bson.D{{"$sort", bson.D{{"_id", 1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - skip: "https://github.com/FerretDB/FerretDB/issues/1992", + skip: "https://github.com/FerretDB/FerretDB/issues/1992", }, "GroupIDTwice": { pipeline: bson.A{ @@ -51,8 +49,7 @@ func TestAggregateVariablesCompatRoot(t *testing.T) { bson.D{{"$group", bson.D{{"_id", "$$ROOT"}}}}, bson.D{{"$sort", bson.D{{"_id", 1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - skip: "https://github.com/FerretDB/FerretDB/issues/1992", + skip: "https://github.com/FerretDB/FerretDB/issues/1992", }, "GroupIDExpression": { pipeline: bson.A{ @@ -62,8 +59,7 @@ func TestAggregateVariablesCompatRoot(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", 1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - skip: "https://github.com/FerretDB/FerretDB/issues/1992", + skip: "https://github.com/FerretDB/FerretDB/issues/1992", }, "GroupSumAccumulator": { pipeline: bson.A{ @@ -74,7 +70,6 @@ func TestAggregateVariablesCompatRoot(t *testing.T) { }}}, bson.D{{"$sort", bson.D{{"_id", -1}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", }, "ProjectSumOperator": { pipeline: bson.A{ @@ -82,8 +77,7 @@ func TestAggregateVariablesCompatRoot(t *testing.T) { {"sum", bson.D{{"$sum", "$$ROOT"}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - skip: "https://github.com/FerretDB/FerretDB/issues/1992", + skip: "https://github.com/FerretDB/FerretDB/issues/1992", }, "ProjectTypeOperator": { pipeline: bson.A{ @@ -91,22 +85,19 @@ func TestAggregateVariablesCompatRoot(t *testing.T) { {"type", bson.D{{"$type", "$$ROOT"}}}, }}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - skip: "https://github.com/FerretDB/FerretDB/issues/1992", + skip: "https://github.com/FerretDB/FerretDB/issues/1992", }, "Set": { pipeline: bson.A{ bson.D{{"$set", bson.D{{"field", "$$ROOT"}}}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - skip: "https://github.com/FerretDB/FerretDB/issues/1413", + skip: "https://github.com/FerretDB/FerretDB/issues/1413", }, "Unwind": { pipeline: bson.A{ bson.D{{"$unwind", "$$ROOT"}}, }, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3148", - resultType: emptyResult, + resultType: emptyResult, }, } From bd4c457af9067fb305b4f8857b23523905260a1b Mon Sep 17 00:00:00 2001 From: noisersup Date: Wed, 23 Aug 2023 16:34:35 +0200 Subject: [PATCH 04/16] replace wrong names --- integration/findandmodify_compat_test.go | 2 +- integration/update_array_compat_test.go | 2 +- integration/update_field_compat_test.go | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/integration/findandmodify_compat_test.go b/integration/findandmodify_compat_test.go index 0cee1cbf1b3e..e6fcb5315439 100644 --- a/integration/findandmodify_compat_test.go +++ b/integration/findandmodify_compat_test.go @@ -543,7 +543,7 @@ func TestFindAndModifyCompatUpsert(t *testing.T) { {"new", true}, }, }, - "UpsertNoSuchReplaceDocument": { + "UpsertNoReplaceDocument": { command: bson.D{ {"query", bson.D{{"_id", "no-such-doc"}}}, {"update", bson.D{{"v", 43.13}}}, diff --git a/integration/update_array_compat_test.go b/integration/update_array_compat_test.go index 674d8d735633..277cf0cab93f 100644 --- a/integration/update_array_compat_test.go +++ b/integration/update_array_compat_test.go @@ -268,7 +268,7 @@ func TestUpdateArrayCompatAddToSetEach(t *testing.T) { update: bson.D{{"$addToSet", bson.D{{"v.0.foo.0.bar", bson.D{{"$each", bson.A{int32(42)}}}}}}}, resultType: emptyResult, }, - "DotNotationPathNotExist": { + "DotNotPathNotExist": { update: bson.D{{"$addToSet", bson.D{{"non.existent.path", bson.D{{"$each", bson.A{int32(42)}}}}}}}, }, } diff --git a/integration/update_field_compat_test.go b/integration/update_field_compat_test.go index 217ae9fe2988..ef9228d767cb 100644 --- a/integration/update_field_compat_test.go +++ b/integration/update_field_compat_test.go @@ -212,17 +212,17 @@ func TestUpdateFieldCompatIncComplex(t *testing.T) { "DotNotationNegativeIndex": { update: bson.D{{"$inc", bson.D{{"v.-1", int32(42)}}}}, }, - "DotNotationIndexOutsideArray": { + "DotNotIndexOutsideArray": { update: bson.D{{"$inc", bson.D{{"v.100", int32(42)}}}}, }, - "DotNotationArrayFieldNotExist": { + "DotNotArrayFieldNotExist": { update: bson.D{{"$inc", bson.D{{"v.array.foo", int32(1)}}}}, skip: "TODO: fix namespace error", }, - "DotNotationArrayFieldExist": { + "DotNotArrayFieldExist": { update: bson.D{{"$inc", bson.D{{"v.array.0", int32(1)}}}}, }, - "DotNotationArrayFieldValue": { + "DotNotArrayFieldValue": { update: bson.D{{"$inc", bson.D{{"v.0.foo", int32(1)}}}}, }, } @@ -959,7 +959,7 @@ func TestUpdateFieldCompatSetOnInsert(t *testing.T) { update: bson.D{{"$setOnInsert", bson.D{{"v.-1.bar", int32(1)}}}}, resultType: emptyResult, }, - "DotNotationIndexOutOfArr": { + "DotNotIndexOutOfArr": { update: bson.D{{"$setOnInsert", bson.D{{"v.100.bar", int32(1)}}}}, resultType: emptyResult, }, @@ -1194,7 +1194,7 @@ func TestUpdateFieldCompatMul(t *testing.T) { update: bson.D{{"$mul", bson.D{{"v..", int32(45)}}}}, resultType: emptyResult, }, - "DotNotationIndexExceedsArrayLength": { + "DotNotIndexOverArrayLength": { update: bson.D{{"$mul", bson.D{{"v.100.bar", int32(45)}}}}, }, "DotNotationFieldNumericName": { From 512614d4468b4a2b99b5b2d58e7b908cb001ab6b Mon Sep 17 00:00:00 2001 From: noisersup Date: Wed, 23 Aug 2023 16:46:13 +0200 Subject: [PATCH 05/16] wip --- integration/update_compat_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/integration/update_compat_test.go b/integration/update_compat_test.go index f65b668a4bd2..403ddc80ba85 100644 --- a/integration/update_compat_test.go +++ b/integration/update_compat_test.go @@ -557,10 +557,11 @@ func TestUpdateCompat(t *testing.T) { failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3183", }, "UpdateNonExistentUpsert": { - filter: bson.D{{"_id", "non-existent"}}, - update: bson.D{{"$set", bson.D{{"v", int32(42)}}}}, - updateOpts: options.Update().SetUpsert(true), - resultType: emptyResult, + filter: bson.D{{"_id", "non-existent"}}, + update: bson.D{{"$set", bson.D{{"v", int32(42)}}}}, + updateOpts: options.Update().SetUpsert(true), + resultType: emptyResult, + failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3183", }, } From 76a6d5bca50d4b06c1de01a25edd5b9260411776 Mon Sep 17 00:00:00 2001 From: noisersup Date: Wed, 23 Aug 2023 16:52:54 +0200 Subject: [PATCH 06/16] dirty fix --- integration/insert_compat_test.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/integration/insert_compat_test.go b/integration/insert_compat_test.go index 16c462db385a..e55834c07147 100644 --- a/integration/insert_compat_test.go +++ b/integration/insert_compat_test.go @@ -103,7 +103,12 @@ func testInsertCompat(tt *testing.T, testCases map[string]insertCompatTestCase) tt.Helper() tt.Parallel() - ctx, targetCollections, compatCollections := setup.SetupCompat(tt) + var t testtb.TB = tt + if tc.failsForSQLite != "" { + t = setup.FailsForSQLite(tt, tc.failsForSQLite) + } + + ctx, targetCollections, compatCollections := setup.SetupCompat(t) insert := tc.insert require.NotEmpty(tt, insert, "insert should be set") @@ -112,13 +117,14 @@ func testInsertCompat(tt *testing.T, testCases map[string]insertCompatTestCase) for i := range targetCollections { targetCollection := targetCollections[i] compatCollection := compatCollections[i] + tt.Run(targetCollection.Name(), func(tt *testing.T) { tt.Helper() - var t testtb.TB = tt - if tc.failsForSQLite != "" { - t = setup.FailsForSQLite(tt, tc.failsForSQLite) - } + //var t testtb.TB = tt + //if tc.failsForSQLite != "" { + // t = setup.FailsForSQLite(tt, tc.failsForSQLite) + //} opts := options.InsertMany().SetOrdered(tc.ordered) targetInsertRes, targetErr := targetCollection.InsertMany(ctx, insert, opts) @@ -157,11 +163,6 @@ func testInsertCompat(tt *testing.T, testCases map[string]insertCompatTestCase) }) } - var t testtb.TB = tt - if tc.failsForSQLite != "" { - t = setup.FailsForSQLite(tt, tc.failsForSQLite) - } - switch tc.resultType { case nonEmptyResult: assert.True(t, nonEmptyResults, "expected non-empty results") From bdcd2aca94c82be94e8ce421fdb1f6bfd7f66374 Mon Sep 17 00:00:00 2001 From: noisersup Date: Wed, 23 Aug 2023 17:15:46 +0200 Subject: [PATCH 07/16] repalce fail with skip --- integration/insert_compat_test.go | 91 ++++++++++++++----------------- 1 file changed, 40 insertions(+), 51 deletions(-) diff --git a/integration/insert_compat_test.go b/integration/insert_compat_test.go index e55834c07147..9532055a9501 100644 --- a/integration/insert_compat_test.go +++ b/integration/insert_compat_test.go @@ -25,7 +25,6 @@ import ( "go.mongodb.org/mongo-driver/mongo/options" "github.com/FerretDB/FerretDB/integration/setup" - "github.com/FerretDB/FerretDB/internal/util/testutil/testtb" ) type insertCompatTestCase struct { @@ -33,38 +32,38 @@ type insertCompatTestCase struct { ordered bool // defaults to false resultType compatTestCaseResultType // defaults to nonEmptyResult - failsForSQLite string // optional, if set, the case is expected to fail for SQLite due to given issue + skipForSQLite string // optional, if set, the case is skipped for SQLite due to given issue } // testInsertCompat tests insert compatibility test cases. -func testInsertCompat(tt *testing.T, testCases map[string]insertCompatTestCase) { - tt.Helper() +func testInsertCompat(t *testing.T, testCases map[string]insertCompatTestCase) { + t.Helper() for name, tc := range testCases { name, tc := name, tc - tt.Run(name, func(tt *testing.T) { - tt.Helper() - tt.Parallel() - tt.Run("InsertOne", func(tt *testing.T) { - tt.Helper() - tt.Parallel() + if tc.skipForSQLite != "" && setup.IsSQLite(t) { + t.Skipf(tc.skipForSQLite) + } - ctx, targetCollections, compatCollections := setup.SetupCompat(tt) + t.Run(name, func(t *testing.T) { + t.Helper() + t.Parallel() + + t.Run("InsertOne", func(t *testing.T) { + t.Helper() + t.Parallel() + + ctx, targetCollections, compatCollections := setup.SetupCompat(t) insert := tc.insert - require.NotEmpty(tt, insert, "insert should be set") + require.NotEmpty(t, insert, "insert should be set") for i := range targetCollections { targetCollection := targetCollections[i] compatCollection := compatCollections[i] - tt.Run(targetCollection.Name(), func(tt *testing.T) { - tt.Helper() - - var t testtb.TB = tt - if tc.failsForSQLite != "" { - t = setup.FailsForSQLite(tt, tc.failsForSQLite) - } + t.Run(targetCollection.Name(), func(t *testing.T) { + t.Helper() for _, doc := range insert { targetInsertRes, targetErr := targetCollection.InsertOne(ctx, doc) @@ -99,32 +98,22 @@ func testInsertCompat(tt *testing.T, testCases map[string]insertCompatTestCase) } }) - tt.Run("InsertMany", func(tt *testing.T) { - tt.Helper() - tt.Parallel() - - var t testtb.TB = tt - if tc.failsForSQLite != "" { - t = setup.FailsForSQLite(tt, tc.failsForSQLite) - } + t.Run("InsertMany", func(t *testing.T) { + t.Helper() + t.Parallel() ctx, targetCollections, compatCollections := setup.SetupCompat(t) insert := tc.insert - require.NotEmpty(tt, insert, "insert should be set") + require.NotEmpty(t, insert, "insert should be set") var nonEmptyResults bool for i := range targetCollections { targetCollection := targetCollections[i] compatCollection := compatCollections[i] - tt.Run(targetCollection.Name(), func(tt *testing.T) { - tt.Helper() - - //var t testtb.TB = tt - //if tc.failsForSQLite != "" { - // t = setup.FailsForSQLite(tt, tc.failsForSQLite) - //} + t.Run(targetCollection.Name(), func(t *testing.T) { + t.Helper() opts := options.InsertMany().SetOrdered(tc.ordered) targetInsertRes, targetErr := targetCollection.InsertMany(ctx, insert, opts) @@ -185,14 +174,14 @@ func TestInsertCompat(t *testing.T) { }, "IDArray": { - insert: []any{bson.D{{"_id", bson.A{"foo", "bar"}}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", + insert: []any{bson.D{{"_id", bson.A{"foo", "bar"}}}}, + resultType: emptyResult, + skipForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", }, "IDRegex": { - insert: []any{bson.D{{"_id", primitive.Regex{Pattern: "^regex$", Options: "i"}}}}, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", + insert: []any{bson.D{{"_id", primitive.Regex{Pattern: "^regex$", Options: "i"}}}}, + resultType: emptyResult, + skipForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", }, "OrderedAllErrors": { @@ -200,18 +189,18 @@ func TestInsertCompat(t *testing.T) { bson.D{{"_id", bson.A{"foo", "bar"}}}, bson.D{{"_id", primitive.Regex{Pattern: "^regex$", Options: "i"}}}, }, - ordered: true, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", + ordered: true, + resultType: emptyResult, + skipForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", }, "UnorderedAllErrors": { insert: []any{ bson.D{{"_id", bson.A{"foo", "bar"}}}, bson.D{{"_id", primitive.Regex{Pattern: "^regex$", Options: "i"}}}, }, - ordered: false, - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", + ordered: false, + resultType: emptyResult, + skipForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", }, "OrderedOneError": { @@ -220,8 +209,8 @@ func TestInsertCompat(t *testing.T) { bson.D{{"_id", primitive.Regex{Pattern: "^regex$", Options: "i"}}}, bson.D{{"_id", "2"}}, }, - ordered: true, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", + ordered: true, + skipForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", }, "UnorderedOneError": { insert: []any{ @@ -230,8 +219,8 @@ func TestInsertCompat(t *testing.T) { bson.D{{"_id", primitive.Regex{Pattern: "^regex$", Options: "i"}}}, bson.D{{"_id", "2"}}, }, - ordered: false, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", + ordered: false, + skipForSQLite: "https://github.com/FerretDB/FerretDB/issues/2750", }, } From 03dda3f60dca28a008712d7d1d2512d1446dc40b Mon Sep 17 00:00:00 2001 From: noisersup Date: Wed, 23 Aug 2023 18:14:21 +0200 Subject: [PATCH 08/16] wip --- integration/update_compat_test.go | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/integration/update_compat_test.go b/integration/update_compat_test.go index 403ddc80ba85..3839d3f5725d 100644 --- a/integration/update_compat_test.go +++ b/integration/update_compat_test.go @@ -42,8 +42,8 @@ type updateCompatTestCase struct { resultType compatTestCaseResultType // defaults to nonEmptyResult providers []shareddata.Provider // defaults to shareddata.AllProviders() - skip string // skips test if non-empty - failsForSQLite string // optional, if set, the case is expected to fail for SQLite due to given issue + skip string // skips test if non-empty + skipForSQLite string // optional, if set, the case is skipped for SQLite due to given issue } // testUpdateCompat tests update compatibility test cases. @@ -59,6 +59,10 @@ func testUpdateCompat(t *testing.T, testCases map[string]updateCompatTestCase) { t.Skip(tc.skip) } + if tc.skipForSQLite != "" { + t.Skip(tc.skipForSQLite) + } + t.Parallel() providers := shareddata.AllProviders() @@ -550,18 +554,18 @@ func TestUpdateCompat(t *testing.T) { replace: bson.D{}, }, "ReplaceNonExistentUpsert": { - filter: bson.D{{"non-existent", "no-match"}}, - replace: bson.D{{"_id", "new"}}, - replaceOpts: options.Replace().SetUpsert(true), - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3183", + filter: bson.D{{"non-existent", "no-match"}}, + replace: bson.D{{"_id", "new"}}, + replaceOpts: options.Replace().SetUpsert(true), + resultType: emptyResult, + skipForSQLite: "https://github.com/FerretDB/FerretDB/issues/3183", }, "UpdateNonExistentUpsert": { - filter: bson.D{{"_id", "non-existent"}}, - update: bson.D{{"$set", bson.D{{"v", int32(42)}}}}, - updateOpts: options.Update().SetUpsert(true), - resultType: emptyResult, - failsForSQLite: "https://github.com/FerretDB/FerretDB/issues/3183", + filter: bson.D{{"_id", "non-existent"}}, + update: bson.D{{"$set", bson.D{{"v", int32(42)}}}}, + updateOpts: options.Update().SetUpsert(true), + resultType: emptyResult, + skipForSQLite: "https://github.com/FerretDB/FerretDB/issues/3183", }, } From b18c3b8b4f6fd6ab80a317ea72119e300031bed5 Mon Sep 17 00:00:00 2001 From: noisersup Date: Wed, 23 Aug 2023 18:16:54 +0200 Subject: [PATCH 09/16] wip --- integration/aggregate_documents_compat_test.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/integration/aggregate_documents_compat_test.go b/integration/aggregate_documents_compat_test.go index 275d24166c8e..31855d351357 100644 --- a/integration/aggregate_documents_compat_test.go +++ b/integration/aggregate_documents_compat_test.go @@ -29,7 +29,6 @@ import ( "github.com/FerretDB/FerretDB/integration/setup" "github.com/FerretDB/FerretDB/integration/shareddata" - "github.com/FerretDB/FerretDB/internal/util/testutil/testtb" ) // aggregateStagesCompatTestCase describes aggregation stages compatibility test case. @@ -175,8 +174,7 @@ type aggregateCommandCompatTestCase struct { command bson.D // required resultType compatTestCaseResultType // defaults to nonEmptyResult - skip string // skip test for all handlers, must have issue number mentioned - failsForSQLite string // optional, if set, the case is expected to fail for SQLite due to given issue + skip string // skip test for all handlers, must have issue number mentioned } // testAggregateCommandCompat tests aggregate pipeline compatibility test cases using one collection. @@ -212,10 +210,7 @@ func testAggregateCommandCompat(tt *testing.T, testCases map[string]aggregateCom tt.Run(targetCollection.Name(), func(tt *testing.T) { tt.Helper() - var t testtb.TB = tt - if tc.failsForSQLite != "" { - t = setup.FailsForSQLite(tt, tc.failsForSQLite) - } + t := setup.FailsForSQLite(tt, "https://github.com/FerretDB/FerretDB/issues/3148") var targetRes, compatRes bson.D targetErr := targetCollection.Database().RunCommand(ctx, command).Decode(&targetRes) @@ -243,7 +238,8 @@ func testAggregateCommandCompat(tt *testing.T, testCases map[string]aggregateCom } }) - if tc.failsForSQLite != "" && setup.IsSQLite(tt) { + // TODO https://github.com/FerretDB/FerretDB/issues/3148 + if setup.IsSQLite(tt) { return } From 89fd67bdaa88dc82c110ff535f7f297709eab434 Mon Sep 17 00:00:00 2001 From: noisersup Date: Thu, 24 Aug 2023 15:06:28 +0200 Subject: [PATCH 10/16] wip --- integration/indexes_test.go | 48 +++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/integration/indexes_test.go b/integration/indexes_test.go index 09ea47461852..b0b11e8bf697 100644 --- a/integration/indexes_test.go +++ b/integration/indexes_test.go @@ -26,8 +26,8 @@ import ( "github.com/FerretDB/FerretDB/integration/shareddata" ) -func TestDropIndexesCommandErrors(t *testing.T) { - t.Parallel() +func TestDropIndexesCommandErrors(tt *testing.T) { + tt.Parallel() for name, tc := range map[string]struct { //nolint:vet // for readability toCreate []mongo.IndexModel // optional, if set, create the given indexes before drop is called @@ -132,12 +132,14 @@ func TestDropIndexesCommandErrors(t *testing.T) { }, } { name, tc := name, tc - t.Run(name, func(t *testing.T) { + tt.Run(name, func(tt *testing.T) { if tc.skip != "" { - t.Skip(tc.skip) + tt.Skip(tc.skip) } - t.Parallel() + tt.Parallel() + + t := setup.FailsForSQLite(tt, "https://github.com/FerretDB/FerretDB/issues/3183") if tc.command != nil { require.Nil(t, tc.toDrop, "toDrop must be nil when using command") @@ -175,8 +177,8 @@ func TestDropIndexesCommandErrors(t *testing.T) { } } -func TestCreateIndexesCommandInvalidSpec(t *testing.T) { - t.Parallel() +func TestCreateIndexesCommandInvalidSpec(tt *testing.T) { + tt.Parallel() for name, tc := range map[string]struct { indexes any // optional @@ -369,12 +371,14 @@ func TestCreateIndexesCommandInvalidSpec(t *testing.T) { }, } { name, tc := name, tc - t.Run(name, func(t *testing.T) { + tt.Run(name, func(tt *testing.T) { if tc.skip != "" { - t.Skip(tc.skip) + tt.Skip(tc.skip) } - t.Parallel() + tt.Parallel() + + t := setup.FailsForSQLite(tt, "https://github.com/FerretDB/FerretDB/issues/3183") if tc.missingIndexes { require.Nil(t, tc.indexes, "indexes must be nil if missingIndexes is true") @@ -409,8 +413,8 @@ func TestCreateIndexesCommandInvalidSpec(t *testing.T) { } } -func TestCreateIndexesCommandInvalidCollection(t *testing.T) { - t.Parallel() +func TestCreateIndexesCommandInvalidCollection(tt *testing.T) { + tt.Parallel() for name, tc := range map[string]struct { collectionName any @@ -465,12 +469,14 @@ func TestCreateIndexesCommandInvalidCollection(t *testing.T) { }, } { name, tc := name, tc - t.Run(name, func(t *testing.T) { + tt.Run(name, func(tt *testing.T) { if tc.skip != "" { - t.Skip(tc.skip) + tt.Skip(tc.skip) } - t.Parallel() + tt.Parallel() + + t := setup.FailsForSQLite(tt, "https://github.com/FerretDB/FerretDB/issues/3183") provider := shareddata.ArrayDocuments // one provider is enough to check for errors ctx, collection := setup.Setup(t, provider) @@ -489,8 +495,8 @@ func TestCreateIndexesCommandInvalidCollection(t *testing.T) { } } -func TestDropIndexesCommandInvalidCollection(t *testing.T) { - t.Parallel() +func TestDropIndexesCommandInvalidCollection(tt *testing.T) { + tt.Parallel() for name, tc := range map[string]struct { collectionName any @@ -539,12 +545,14 @@ func TestDropIndexesCommandInvalidCollection(t *testing.T) { }, } { name, tc := name, tc - t.Run(name, func(t *testing.T) { + tt.Run(name, func(tt *testing.T) { if tc.skip != "" { - t.Skip(tc.skip) + tt.Skip(tc.skip) } - t.Parallel() + tt.Parallel() + + t := setup.FailsForSQLite(tt, "https://github.com/FerretDB/FerretDB/issues/3183") provider := shareddata.ArrayDocuments // one provider is enough to check for errors ctx, collection := setup.Setup(t, provider) From 1e4fbb09c226c7712a6b28dff0d82b8cae4413d0 Mon Sep 17 00:00:00 2001 From: noisersup Date: Thu, 24 Aug 2023 16:09:08 +0200 Subject: [PATCH 11/16] wip --- integration/aggregate_documents_test.go | 12 +++++++----- integration/aggregate_query_test.go | 21 ++++++++++++--------- integration/findandmodify_test.go | 6 ++---- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/integration/aggregate_documents_test.go b/integration/aggregate_documents_test.go index 1acfd3332d56..015368fcdf39 100644 --- a/integration/aggregate_documents_test.go +++ b/integration/aggregate_documents_test.go @@ -872,8 +872,8 @@ func TestAggregateUnsetErrors(t *testing.T) { } } -func TestAggregateSortErrors(t *testing.T) { - t.Parallel() +func TestAggregateSortErrors(tt *testing.T) { + tt.Parallel() for name, tc := range map[string]struct { //nolint:vet // used for test only pipeline bson.A // required, aggregation pipeline stages @@ -894,12 +894,14 @@ func TestAggregateSortErrors(t *testing.T) { }, } { name, tc := name, tc - t.Run(name, func(t *testing.T) { + tt.Run(name, func(tt *testing.T) { if tc.skip != "" { - t.Skip(tc.skip) + tt.Skip(tc.skip) } - t.Parallel() + tt.Parallel() + + t := setup.FailsForSQLite(tt, "https://github.com/FerretDB/FerretDB/issues/3148") require.NotNil(t, tc.pipeline, "pipeline must not be nil") require.NotNil(t, tc.err, "err must not be nil") diff --git a/integration/aggregate_query_test.go b/integration/aggregate_query_test.go index dffc0f80e2a9..fa2e1d00dec9 100644 --- a/integration/aggregate_query_test.go +++ b/integration/aggregate_query_test.go @@ -25,17 +25,18 @@ import ( "github.com/FerretDB/FerretDB/integration/shareddata" ) -func TestAggregateMatchExprErrors(t *testing.T) { - t.Parallel() +func TestAggregateMatchExprErrors(tt *testing.T) { + tt.Parallel() - ctx, collection := setup.Setup(t, shareddata.Composites) + ctx, collection := setup.Setup(tt, shareddata.Composites) for name, tc := range map[string]struct { //nolint:vet // used for test only pipeline bson.A // required, aggregation pipeline stages - err *mongo.CommandError // required - altMessage string // optional, alternative error message - skip string // optional, skip test with a specified reason + err *mongo.CommandError // required + altMessage string // optional, alternative error message + skip string // optional, skip test with a specified reason + failsForSQLite string // optional, if set, the case is expected to fail for SQLite due to given issue} }{ "TooManyFields": { pipeline: bson.A{ @@ -173,12 +174,14 @@ func TestAggregateMatchExprErrors(t *testing.T) { }, } { name, tc := name, tc - t.Run(name, func(t *testing.T) { + tt.Run(name, func(tt *testing.T) { if tc.skip != "" { - t.Skip(tc.skip) + tt.Skip(tc.skip) } - t.Parallel() + tt.Parallel() + + t := setup.FailsForSQLite(tt, "https://github.com/FerretDB/FerretDB/issues/3148") require.NotNil(t, tc.pipeline, "pipeline must not be nil") require.NotNil(t, tc.err, "err must not be nil") diff --git a/integration/findandmodify_test.go b/integration/findandmodify_test.go index bf319b2f0c21..97d338d2c9ed 100644 --- a/integration/findandmodify_test.go +++ b/integration/findandmodify_test.go @@ -588,10 +588,8 @@ func TestFindAndModifyCommandUpsert(t *testing.T) { } } -func TestFindAndModifyCommentMethod(tt *testing.T) { - tt.Parallel() - - t := setup.FailsForSQLite(tt, "https://github.com/FerretDB/FerretDB/issues/3049") +func TestFindAndModifyCommentMethod(t *testing.T) { + t.Parallel() ctx, collection := setup.Setup(t, shareddata.Scalars) From 943574a557c056ec2e8d2ff9c9c053965a487846 Mon Sep 17 00:00:00 2001 From: noisersup Date: Thu, 24 Aug 2023 16:35:05 +0200 Subject: [PATCH 12/16] wip --- integration/helpers.go | 3 +-- integration/insert_command_test.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/integration/helpers.go b/integration/helpers.go index e49442878afa..2c5d6d8a6869 100644 --- a/integration/helpers.go +++ b/integration/helpers.go @@ -17,7 +17,6 @@ package integration import ( "context" - "testing" "time" "github.com/stretchr/testify/assert" @@ -294,7 +293,7 @@ func AssertEqualAltCommandError(t testtb.TB, expected mongo.CommandError, altMes // AssertEqualAltWriteError asserts that the expected MongoDB error is the same as the actual; // the alternative error message may be provided if FerretDB is unable to produce exactly the same text as MongoDB. -func AssertEqualAltWriteError(t *testing.T, expected mongo.WriteError, altMessage string, actual error) bool { +func AssertEqualAltWriteError(t testtb.TB, expected mongo.WriteError, altMessage string, actual error) bool { t.Helper() we, ok := actual.(mongo.WriteException) diff --git a/integration/insert_command_test.go b/integration/insert_command_test.go index ade17e7bf4fd..85d1518c14fa 100644 --- a/integration/insert_command_test.go +++ b/integration/insert_command_test.go @@ -121,12 +121,12 @@ func TestInsertCommandErrors(tt *testing.T) { assert.Nil(t, res) if tc.cerr != nil { - AssertEqualAltCommandError(tt, *tc.cerr, tc.altMessage, err) + AssertEqualAltCommandError(t, *tc.cerr, tc.altMessage, err) return } if tc.werr != nil { - AssertEqualAltWriteError(tt, *tc.werr, tc.altMessage, err) + AssertEqualAltWriteError(t, *tc.werr, tc.altMessage, err) return } From f01f2dd509fcc70c1c361c5fa4abeb4bede655ec Mon Sep 17 00:00:00 2001 From: noisersup Date: Fri, 25 Aug 2023 11:39:51 +0200 Subject: [PATCH 13/16] todo comments --- integration/aggregate_documents_compat_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/integration/aggregate_documents_compat_test.go b/integration/aggregate_documents_compat_test.go index f8b02a5a7b78..a3c57dd6fda7 100644 --- a/integration/aggregate_documents_compat_test.go +++ b/integration/aggregate_documents_compat_test.go @@ -153,6 +153,7 @@ func testAggregateStagesCompatWithProviders(tt *testing.T, providers shareddata. }) } + // TODO https://github.com/FerretDB/FerretDB/issues/3148 if setup.IsSQLite(tt) { return } From 75b36dc367296e7e1f1fdc5cfca1e6912d4f98d7 Mon Sep 17 00:00:00 2001 From: noisersup Date: Fri, 25 Aug 2023 12:31:47 +0200 Subject: [PATCH 14/16] wip --- integration/update_field_compat_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/update_field_compat_test.go b/integration/update_field_compat_test.go index ef9228d767cb..2ba898051985 100644 --- a/integration/update_field_compat_test.go +++ b/integration/update_field_compat_test.go @@ -212,17 +212,17 @@ func TestUpdateFieldCompatIncComplex(t *testing.T) { "DotNotationNegativeIndex": { update: bson.D{{"$inc", bson.D{{"v.-1", int32(42)}}}}, }, - "DotNotIndexOutsideArray": { + "DotNotatIndexOutsideArray": { update: bson.D{{"$inc", bson.D{{"v.100", int32(42)}}}}, }, - "DotNotArrayFieldNotExist": { + "DotNotatArrayFieldNotExist": { update: bson.D{{"$inc", bson.D{{"v.array.foo", int32(1)}}}}, skip: "TODO: fix namespace error", }, - "DotNotArrayFieldExist": { + "DotNotatArrFieldExist": { update: bson.D{{"$inc", bson.D{{"v.array.0", int32(1)}}}}, }, - "DotNotArrayFieldValue": { + "DotNotatArrFieldValue": { update: bson.D{{"$inc", bson.D{{"v.0.foo", int32(1)}}}}, }, } From 3a7c60edda2cfc7572738da6d35ce04697c1c87d Mon Sep 17 00:00:00 2001 From: noisersup Date: Fri, 25 Aug 2023 12:37:05 +0200 Subject: [PATCH 15/16] wip --- integration/update_array_compat_test.go | 2 +- integration/update_field_compat_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integration/update_array_compat_test.go b/integration/update_array_compat_test.go index 277cf0cab93f..ae858054cfc4 100644 --- a/integration/update_array_compat_test.go +++ b/integration/update_array_compat_test.go @@ -268,7 +268,7 @@ func TestUpdateArrayCompatAddToSetEach(t *testing.T) { update: bson.D{{"$addToSet", bson.D{{"v.0.foo.0.bar", bson.D{{"$each", bson.A{int32(42)}}}}}}}, resultType: emptyResult, }, - "DotNotPathNotExist": { + "DotNotatPathNotExist": { update: bson.D{{"$addToSet", bson.D{{"non.existent.path", bson.D{{"$each", bson.A{int32(42)}}}}}}}, }, } diff --git a/integration/update_field_compat_test.go b/integration/update_field_compat_test.go index 2ba898051985..e0605d4b6f71 100644 --- a/integration/update_field_compat_test.go +++ b/integration/update_field_compat_test.go @@ -959,7 +959,7 @@ func TestUpdateFieldCompatSetOnInsert(t *testing.T) { update: bson.D{{"$setOnInsert", bson.D{{"v.-1.bar", int32(1)}}}}, resultType: emptyResult, }, - "DotNotIndexOutOfArr": { + "DotNotatIndexOutOfArr": { update: bson.D{{"$setOnInsert", bson.D{{"v.100.bar", int32(1)}}}}, resultType: emptyResult, }, @@ -1194,7 +1194,7 @@ func TestUpdateFieldCompatMul(t *testing.T) { update: bson.D{{"$mul", bson.D{{"v..", int32(45)}}}}, resultType: emptyResult, }, - "DotNotIndexOverArrayLength": { + "DotNotatIndexOverArrayLen": { update: bson.D{{"$mul", bson.D{{"v.100.bar", int32(45)}}}}, }, "DotNotationFieldNumericName": { From 656125b553fa0fbc9e48eb3ce122ea14c89dbcc4 Mon Sep 17 00:00:00 2001 From: noisersup Date: Fri, 25 Aug 2023 13:46:48 +0200 Subject: [PATCH 16/16] wip --- integration/update_field_compat_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/update_field_compat_test.go b/integration/update_field_compat_test.go index e0605d4b6f71..fa98b1da3fff 100644 --- a/integration/update_field_compat_test.go +++ b/integration/update_field_compat_test.go @@ -212,7 +212,7 @@ func TestUpdateFieldCompatIncComplex(t *testing.T) { "DotNotationNegativeIndex": { update: bson.D{{"$inc", bson.D{{"v.-1", int32(42)}}}}, }, - "DotNotatIndexOutsideArray": { + "DotNotatIndexOutOfArray": { update: bson.D{{"$inc", bson.D{{"v.100", int32(42)}}}}, }, "DotNotatArrayFieldNotExist": {