Skip to content

Commit ff71a1d

Browse files
committed
Ignore tests of group command with MongodDB >= 4.1
1 parent fff1bbd commit ff71a1d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import spock.lang.IgnoreIf
3030

3131
import static com.mongodb.ClusterFixture.serverVersionAtLeast
3232

33+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
3334
class GroupOperationSpecification extends OperationFunctionalSpecification {
3435

3536
def reduceFunction = new BsonJavaScript('''

driver-legacy/src/test/functional/com/mongodb/DBCollectionFunctionalSpecification.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
364364
collection.save(~['x': 'c']);
365365
}
366366

367+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
367368
def 'should group by the x field and apply the provided count function'() {
368369
given:
369370
insertDataForGroupTests()
@@ -379,6 +380,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
379380
that result, contains(~['x': 'a', 'count': 3.0D], ~['x': 'b', 'count': 4.0D], ~['x': 'c', 'count': 1.0D]);
380381
}
381382

383+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
382384
def 'should group by the x field and apply the provided count function using a GroupCommand'() {
383385
given:
384386
insertDataForGroupTests()
@@ -397,6 +399,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
397399
that result, contains(~['x': 'a', 'count': 3.0D], ~['x': 'b', 'count': 4.0D], ~['x': 'c', 'count': 1.0D]);
398400
}
399401

402+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
400403
def 'should group using a key function in a GroupCommand'() {
401404
given:
402405
insertDataForGroupTests()
@@ -415,6 +418,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
415418
that result, contains(~['x': 'a', 'count': 3.0D], ~['x': 'b', 'count': 4.0D], ~['x': 'c', 'count': 1.0D]);
416419
}
417420

421+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
418422
def 'should group and count only those documents that fulfull the given condition'() {
419423
given:
420424
insertDataForGroupTests()
@@ -430,6 +434,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
430434
that result, contains(~['x': 'b', 'count': 4.0D]);
431435
}
432436

437+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
433438
def 'should be able to set a value in the results'() {
434439
given:
435440
insertDataForGroupTests()
@@ -445,6 +450,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
445450
that result, contains(~['x': 'c', 'valueFound': true]);
446451
}
447452

453+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
448454
def 'should return results set by the function, based on condition supplied without key'() {
449455
given:
450456
insertDataForGroupTests()
@@ -460,6 +466,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
460466
that result, contains(~['valueFound': true]);
461467
}
462468

469+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
463470
def 'finalize function should replace the whole result document if a document is the return type of finalize function'() {
464471
given:
465472
insertDataForGroupTests()
@@ -476,6 +483,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
476483
that result, contains(~['a': 1.0D]);
477484
}
478485

486+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
479487
def 'finalize function should modify the result document'() {
480488
given:
481489
insertDataForGroupTests()
@@ -492,6 +500,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
492500
that result, contains(~['x': 'b', 'valueFound': true, 'a': 1.0D]);
493501
}
494502

503+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
495504
def 'should throw an Exception if no initial document provided'() {
496505
when:
497506
collection.group(~['x': 1],
@@ -503,6 +512,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
503512
thrown(IllegalArgumentException)
504513
}
505514

515+
@IgnoreIf({ serverVersionAtLeast(4, 1) })
506516
def 'should throw an Exception if no reduce function provided'() {
507517
when:
508518
collection.group(~['x': 1],

0 commit comments

Comments
 (0)