Skip to content

Commit 07e49da

Browse files
committed
GODRIVER-1794 remove SetBucketSize from TestIndexView/create_one/all_options (#555)
1 parent b10e639 commit 07e49da

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

mongo/integration/index_view_test.go

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,31 +71,36 @@ func TestIndexView(t *testing.T) {
7171
})
7272
})
7373
mt.Run("all options", func(mt *mtest.T) {
74+
opts := options.Index().
75+
SetBackground(false).
76+
SetExpireAfterSeconds(10).
77+
SetName("a").
78+
SetSparse(false).
79+
SetUnique(false).
80+
SetVersion(1).
81+
SetDefaultLanguage("english").
82+
SetLanguageOverride("english").
83+
SetTextVersion(1).
84+
SetWeights(bson.D{}).
85+
SetSphereVersion(1).
86+
SetBits(2).
87+
SetMax(10).
88+
SetMin(1).
89+
SetPartialFilterExpression(bson.D{}).
90+
SetStorageEngine(bson.D{
91+
{"wiredTiger", bson.D{
92+
{"configString", "block_compressor=zlib"},
93+
}},
94+
})
95+
96+
// Only check SetBucketSize if version is less than 4.9
97+
if mtest.CompareServerVersions(mtest.ServerVersion(), "4.9") < 0 {
98+
opts.SetBucketSize(1)
99+
}
74100
// Omits collation option because it's incompatible with version option
75101
_, err := mt.Coll.Indexes().CreateOne(mtest.Background, mongo.IndexModel{
76-
Keys: bson.D{{"foo", "text"}},
77-
Options: options.Index().
78-
SetBackground(false).
79-
SetExpireAfterSeconds(10).
80-
SetName("a").
81-
SetSparse(false).
82-
SetUnique(false).
83-
SetVersion(1).
84-
SetDefaultLanguage("english").
85-
SetLanguageOverride("english").
86-
SetTextVersion(1).
87-
SetWeights(bson.D{}).
88-
SetSphereVersion(1).
89-
SetBits(2).
90-
SetMax(10).
91-
SetMin(1).
92-
SetBucketSize(1).
93-
SetPartialFilterExpression(bson.D{}).
94-
SetStorageEngine(bson.D{
95-
{"wiredTiger", bson.D{
96-
{"configString", "block_compressor=zlib"},
97-
}},
98-
}),
102+
Keys: bson.D{{"foo", "text"}},
103+
Options: opts,
99104
})
100105
assert.Nil(mt, err, "CreateOne error: %v", err)
101106
})

0 commit comments

Comments
 (0)