Skip to content

Commit

Permalink
Skip legacy explain tests on server > 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jyemin committed Apr 12, 2022
1 parent 412c62d commit 7360e36
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import spock.lang.IgnoreIf
import spock.lang.Subject

import static com.mongodb.ClusterFixture.serverVersionAtLeast
import static com.mongodb.ClusterFixture.serverVersionGreaterThan

class DBCursorFunctionalSpecification extends FunctionalSpecification {

Expand Down Expand Up @@ -51,7 +52,7 @@ class DBCursorFunctionalSpecification extends FunctionalSpecification {
1 * decoder.decode(_ as byte[], collection)
}

@IgnoreIf({ serverVersionAtLeast(3, 0) })
@IgnoreIf({ serverVersionAtLeast(3, 0) || serverVersionGreaterThan('5.0') })
def 'should use provided hints for queries'() {
given:
collection.createIndex(new BasicDBObject('a', 1))
Expand All @@ -69,7 +70,7 @@ class DBCursorFunctionalSpecification extends FunctionalSpecification {
dbCursor.explain().get('cursor') == 'BtreeCursor a_1'
}

@IgnoreIf({ !serverVersionAtLeast(3, 0) })
@IgnoreIf({ !serverVersionAtLeast(3, 0) || serverVersionGreaterThan('5.0') })
def 'should use provided hints for queries mongod > 3.0'() {
given:
collection.createIndex(new BasicDBObject('a', 1))
Expand Down Expand Up @@ -115,7 +116,7 @@ class DBCursorFunctionalSpecification extends FunctionalSpecification {
}


@IgnoreIf({ !serverVersionAtLeast(3, 0) })
@IgnoreIf({ !serverVersionAtLeast(3, 0) || serverVersionGreaterThan('5.0') })
def 'should use provided string hints for queries mongodb > 2.7'() {
given:
collection.createIndex(new BasicDBObject('a', 1))
Expand Down Expand Up @@ -198,7 +199,7 @@ class DBCursorFunctionalSpecification extends FunctionalSpecification {
dbCursor.next().get('cursor') == 'BtreeCursor a_1'
}

@IgnoreIf({ !serverVersionAtLeast(3, 0) })
@IgnoreIf({ !serverVersionAtLeast(3, 0) || serverVersionGreaterThan('5.0') })
def 'should be able to use addSpecial with $explain mongod > 2.7'() {
given:
collection.createIndex(new BasicDBObject('a', 1))
Expand Down

0 comments on commit 7360e36

Please sign in to comment.