Skip to content

Commit b9bc98c

Browse files
committed
Limit geoHaystack index testing to MongoDB 4.4 and below
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.
1 parent 902925c commit b9bc98c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

driver-core/src/test/functional/com/mongodb/client/model/IndexesFunctionalSpecification.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
package com.mongodb.client.model
1818

1919
import com.mongodb.OperationFunctionalSpecification
20+
import spock.lang.IgnoreIf
2021

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

103+
@IgnoreIf({ serverVersionGreaterThan('4.4') })
101104
def 'geoHaystack'() {
102105
when:
103106
getCollectionHelper().createIndex(geoHaystack('x', descending('b')), 2.0)

driver-core/src/test/functional/com/mongodb/internal/operation/CreateIndexesOperationSpecification.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import static com.mongodb.ClusterFixture.getBinding
4141
import static com.mongodb.ClusterFixture.isDiscoverableReplicaSet
4242
import static com.mongodb.ClusterFixture.isSharded
4343
import static com.mongodb.ClusterFixture.serverVersionAtLeast
44+
import static com.mongodb.ClusterFixture.serverVersionGreaterThan
4445
import static java.util.concurrent.TimeUnit.SECONDS
4546

4647
class CreateIndexesOperationSpecification extends OperationFunctionalSpecification {
@@ -333,6 +334,7 @@ class CreateIndexesOperationSpecification extends OperationFunctionalSpecificati
333334
async << [true, false]
334335
}
335336

337+
@IgnoreIf({ serverVersionGreaterThan('4.4') })
336338
def 'should be able to create a geoHaystack indexes'() {
337339
given:
338340
def operation = new CreateIndexesOperation(getNamespace(),

0 commit comments

Comments
 (0)