Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fixed issue link and clean up integration test provider setup #3052

Merged
merged 7 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use object comparison
  • Loading branch information
chilagrow committed Jul 14, 2023
commit 92bea20aab2a9c1e82e6247925a905e252e60798
20 changes: 10 additions & 10 deletions integration/aggregate_documents_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func TestAggregateCompatGroupDeterministicCollections(t *testing.T) {
// so compat and target results in different order.
// https://github.com/FerretDB/FerretDB/issues/2185

providers := shareddata.AllProviders().Remove("Composites", "ArrayStrings", "ArrayInt32s", "ArrayAndDocuments", "Mixed")
providers := shareddata.AllProviders().Remove(shareddata.Composites, shareddata.ArrayStrings, shareddata.ArrayInt32s, shareddata.ArrayAndDocuments, shareddata.Mixed)
testCases := map[string]aggregateStagesCompatTestCase{
"DistinctValue": {
pipeline: bson.A{
Expand Down Expand Up @@ -637,7 +637,7 @@ func TestAggregateCompatGroupExpressionDottedFields(t *testing.T) {
// FerretDB always sorts empty array is less than null.
// In compat, for `.sort()` an empty array is less than null.
// In compat, for aggregation `$sort` null is less than an empty array.
providers := shareddata.AllProviders().Remove("Mixed", "Composites", "DocumentsDeeplyNested")
providers := shareddata.AllProviders().Remove(shareddata.Mixed, shareddata.Composites, shareddata.DocumentsDeeplyNested)

testCases := map[string]aggregateStagesCompatTestCase{
"NestedInDocument": {
Expand Down Expand Up @@ -872,16 +872,16 @@ func TestAggregateCompatGroupSum(t *testing.T) {

providers := shareddata.AllProviders().
// skipped due to https://github.com/FerretDB/FerretDB/issues/2185.
Remove("Composites").
Remove("ArrayStrings").
Remove("ArrayInt32s").
Remove("Mixed").
Remove("ArrayAndDocuments").
Remove(shareddata.Composites).
Remove(shareddata.ArrayStrings).
Remove(shareddata.ArrayInt32s).
Remove(shareddata.Mixed).
Remove(shareddata.ArrayAndDocuments).
// TODO: handle $sum of doubles near max precision.
// https://github.com/FerretDB/FerretDB/issues/2300
Remove("Doubles").
Remove(shareddata.Doubles).
// TODO: https://github.com/FerretDB/FerretDB/issues/2616
Remove("ArrayDocuments")
Remove(shareddata.ArrayDocuments)

testCases := map[string]aggregateStagesCompatTestCase{
"GroupNullID": {
Expand Down Expand Up @@ -1212,7 +1212,7 @@ func TestAggregateCompatSortDotNotation(t *testing.T) {

providers := shareddata.AllProviders().
// TODO: https://github.com/FerretDB/FerretDB/issues/2617
Remove("ArrayDocuments")
Remove(shareddata.ArrayDocuments)

testCases := map[string]aggregateStagesCompatTestCase{
"DotNotation": {
Expand Down
2 changes: 1 addition & 1 deletion integration/distinct_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func testDistinctCompat(t *testing.T, testCases map[string]distinctCompatTestCas
// Use shared setup because distinct queries can't modify data.
// TODO Use read-only user. https://github.com/FerretDB/FerretDB/issues/1025
s := setup.SetupCompatWithOpts(t, &setup.SetupCompatOpts{
Providers: shareddata.AllProviders().Remove("Scalars"), // Remove provider with the same values with different types
Providers: shareddata.AllProviders().Remove(shareddata.Scalars), // Remove provider with the same values with different types
AddNonExistentCollection: true,
})
ctx, targetCollections, compatCollections := s.Ctx, s.TargetCollections, s.CompatCollections
Expand Down
2 changes: 1 addition & 1 deletion integration/query_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func TestQueryCompatSortDotNotation(t *testing.T) {

providers := shareddata.AllProviders().
// TODO: https://github.com/FerretDB/FerretDB/issues/2618
Remove("ArrayDocuments")
Remove(shareddata.ArrayDocuments)

testCases := map[string]queryCompatTestCase{
"DotNotation": {
Expand Down
6 changes: 3 additions & 3 deletions integration/shareddata/shareddata.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ func AllProviders() Providers {
type Providers []Provider

// Remove specified providers and return remaining providers.
func (ps Providers) Remove(removeProviderNames ...string) Providers {
func (ps Providers) Remove(removeProviders ...Provider) Providers {
res := make([]Provider, 0, len(ps))

for _, p := range ps {
keep := true

for _, name := range removeProviderNames {
if p.Name() == name {
for _, removeProvider := range removeProviders {
if p == removeProvider {
keep = false
break
}
Expand Down
2 changes: 1 addition & 1 deletion integration/update_field_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ func TestUpdateFieldCompatMul(t *testing.T) {
providers := shareddata.AllProviders().
// OverflowVergeDoubles and Scalars contain numbers that produces +INF on compat,
// validation error on target upon $mul operation.
Remove("OverflowVergeDoubles", "Scalars")
Remove(shareddata.OverflowVergeDoubles, shareddata.Scalars)

testCases := map[string]updateCompatTestCase{
"Int32": {
Expand Down