Skip to content

Commit

Permalink
GODRIVER-1794 remove SetBucketSize from TestIndexView/create_one/all_…
Browse files Browse the repository at this point in the history
…options (#555)
  • Loading branch information
iwysiu committed Dec 16, 2020
1 parent b10e639 commit 07e49da
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions mongo/integration/index_view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,36 @@ func TestIndexView(t *testing.T) {
})
})
mt.Run("all options", func(mt *mtest.T) {
opts := options.Index().
SetBackground(false).
SetExpireAfterSeconds(10).
SetName("a").
SetSparse(false).
SetUnique(false).
SetVersion(1).
SetDefaultLanguage("english").
SetLanguageOverride("english").
SetTextVersion(1).
SetWeights(bson.D{}).
SetSphereVersion(1).
SetBits(2).
SetMax(10).
SetMin(1).
SetPartialFilterExpression(bson.D{}).
SetStorageEngine(bson.D{
{"wiredTiger", bson.D{
{"configString", "block_compressor=zlib"},
}},
})

// Only check SetBucketSize if version is less than 4.9
if mtest.CompareServerVersions(mtest.ServerVersion(), "4.9") < 0 {
opts.SetBucketSize(1)
}
// Omits collation option because it's incompatible with version option
_, err := mt.Coll.Indexes().CreateOne(mtest.Background, mongo.IndexModel{
Keys: bson.D{{"foo", "text"}},
Options: options.Index().
SetBackground(false).
SetExpireAfterSeconds(10).
SetName("a").
SetSparse(false).
SetUnique(false).
SetVersion(1).
SetDefaultLanguage("english").
SetLanguageOverride("english").
SetTextVersion(1).
SetWeights(bson.D{}).
SetSphereVersion(1).
SetBits(2).
SetMax(10).
SetMin(1).
SetBucketSize(1).
SetPartialFilterExpression(bson.D{}).
SetStorageEngine(bson.D{
{"wiredTiger", bson.D{
{"configString", "block_compressor=zlib"},
}},
}),
Keys: bson.D{{"foo", "text"}},
Options: opts,
})
assert.Nil(mt, err, "CreateOne error: %v", err)
})
Expand Down

0 comments on commit 07e49da

Please sign in to comment.