Skip to content

Commit

Permalink
Limit geoHaystack index testing to MongoDB 4.4 and below
Browse files Browse the repository at this point in the history
The next release after MongoDB 4.4 removes support for geoHaystack indexes,
so we need to disable tests of them in the driver when running against
server versions > 4.4.
  • Loading branch information
jyemin committed Feb 4, 2021
1 parent 351b524 commit acb17d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
package com.mongodb.client.model

import com.mongodb.OperationFunctionalSpecification
import spock.lang.IgnoreIf

import static com.mongodb.ClusterFixture.serverVersionGreaterThan
import static com.mongodb.client.model.Indexes.ascending
import static com.mongodb.client.model.Indexes.compoundIndex
import static com.mongodb.client.model.Indexes.descending
Expand Down Expand Up @@ -98,6 +100,7 @@ class IndexesFunctionalSpecification extends OperationFunctionalSpecification {
getCollectionHelper().listIndexes()*.get('key').contains(parse('{x : "2d"}'))
}

@IgnoreIf({ serverVersionGreaterThan('4.4') })
def 'geoHaystack'() {
when:
getCollectionHelper().createIndex(geoHaystack('x', descending('b')), 2.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import static com.mongodb.ClusterFixture.getBinding
import static com.mongodb.ClusterFixture.isDiscoverableReplicaSet
import static com.mongodb.ClusterFixture.isSharded
import static com.mongodb.ClusterFixture.serverVersionAtLeast
import static com.mongodb.ClusterFixture.serverVersionGreaterThan
import static java.util.concurrent.TimeUnit.SECONDS

class CreateIndexesOperationSpecification extends OperationFunctionalSpecification {
Expand Down Expand Up @@ -291,6 +292,7 @@ class CreateIndexesOperationSpecification extends OperationFunctionalSpecificati
async << [true, false]
}

@IgnoreIf({ serverVersionGreaterThan('4.4') })
def 'should be able to create a geoHaystack indexes'() {
given:
def operation = new CreateIndexesOperation(getNamespace(),
Expand Down

0 comments on commit acb17d0

Please sign in to comment.