Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-2322 Skip tests with capped collections on serverless #857

Merged
merged 2 commits into from Feb 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions mongo/integration/cursor_test.go
Expand Up @@ -8,6 +8,7 @@ package integration

import (
"context"
"os"
"testing"
"time"

Expand Down Expand Up @@ -47,6 +48,11 @@ func TestCursor(t *testing.T) {
assert.Equal(mt, int32(errorCursorNotFound), ce.Code, "expected error code %v, got %v", errorCursorNotFound, ce.Code)
})
mt.RunOpts("try next", noClientOpts, func(mt *mtest.T) {
// Skip tests if running against serverless, as capped collections are banned.
if os.Getenv("SERVERLESS") == "serverless" {
mt.Skip("skipping as serverless forbids capped collections")
}

mt.Run("existing non-empty batch", func(mt *mtest.T) {
// If there's already documents in the current batch, TryNext should return true without doing a getMore

Expand Down Expand Up @@ -86,6 +92,11 @@ func TestCursor(t *testing.T) {
})
mt.RunOpts("RemainingBatchLength", noClientOpts, func(mt *mtest.T) {
cappedMtOpts := mtest.NewOptions().CollectionCreateOptions(cappedCollectionOpts)
// Skip tests if running against serverless, as capped collections are banned.
if os.Getenv("SERVERLESS") == "serverless" {
mt.Skip("skipping as serverless forbids capped collections")
}

mt.RunOpts("first batch is non empty", cappedMtOpts, func(mt *mtest.T) {
// Test that the cursor reports the correct value for RemainingBatchLength at various execution points if
// the first batch from the server is non-empty.
Expand Down