@@ -8,6 +8,7 @@ package integration
8
8
9
9
import (
10
10
"context"
11
+ "os"
11
12
"testing"
12
13
"time"
13
14
@@ -47,6 +48,11 @@ func TestCursor(t *testing.T) {
47
48
assert .Equal (mt , int32 (errorCursorNotFound ), ce .Code , "expected error code %v, got %v" , errorCursorNotFound , ce .Code )
48
49
})
49
50
mt .RunOpts ("try next" , noClientOpts , func (mt * mtest.T ) {
51
+ // Skip tests if running against serverless, as capped collections are banned.
52
+ if os .Getenv ("SERVERLESS" ) == "serverless" {
53
+ mt .Skip ("skipping as serverless forbids capped collections" )
54
+ }
55
+
50
56
mt .Run ("existing non-empty batch" , func (mt * mtest.T ) {
51
57
// If there's already documents in the current batch, TryNext should return true without doing a getMore
52
58
@@ -86,6 +92,11 @@ func TestCursor(t *testing.T) {
86
92
})
87
93
mt .RunOpts ("RemainingBatchLength" , noClientOpts , func (mt * mtest.T ) {
88
94
cappedMtOpts := mtest .NewOptions ().CollectionCreateOptions (cappedCollectionOpts )
95
+ // Skip tests if running against serverless, as capped collections are banned.
96
+ if os .Getenv ("SERVERLESS" ) == "serverless" {
97
+ mt .Skip ("skipping as serverless forbids capped collections" )
98
+ }
99
+
89
100
mt .RunOpts ("first batch is non empty" , cappedMtOpts , func (mt * mtest.T ) {
90
101
// Test that the cursor reports the correct value for RemainingBatchLength at various execution points if
91
102
// the first batch from the server is non-empty.
0 commit comments