@@ -8,6 +8,7 @@ package integration
88
99import (
1010 "context"
11+ "os"
1112 "testing"
1213 "time"
1314
@@ -47,6 +48,11 @@ func TestCursor(t *testing.T) {
4748 assert .Equal (mt , int32 (errorCursorNotFound ), ce .Code , "expected error code %v, got %v" , errorCursorNotFound , ce .Code )
4849 })
4950 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+
5056 mt .Run ("existing non-empty batch" , func (mt * mtest.T ) {
5157 // If there's already documents in the current batch, TryNext should return true without doing a getMore
5258
@@ -86,6 +92,11 @@ func TestCursor(t *testing.T) {
8692 })
8793 mt .RunOpts ("RemainingBatchLength" , noClientOpts , func (mt * mtest.T ) {
8894 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+
89100 mt .RunOpts ("first batch is non empty" , cappedMtOpts , func (mt * mtest.T ) {
90101 // Test that the cursor reports the correct value for RemainingBatchLength at various execution points if
91102 // the first batch from the server is non-empty.
0 commit comments