From 40c3d54dd0d5aa537707df21db0ed0cc7e2f9cd4 Mon Sep 17 00:00:00 2001 From: Matt Dale <9760375+matthewdale@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:20:23 -0700 Subject: [PATCH] Remove unused functions. --- x/mongo/driver/integration/aggregate_test.go | 47 -------------------- 1 file changed, 47 deletions(-) diff --git a/x/mongo/driver/integration/aggregate_test.go b/x/mongo/driver/integration/aggregate_test.go index f1ff28c2f0..0d34c4db18 100644 --- a/x/mongo/driver/integration/aggregate_test.go +++ b/x/mongo/driver/integration/aggregate_test.go @@ -12,49 +12,14 @@ import ( "testing" "go.mongodb.org/mongo-driver/v2/bson" - "go.mongodb.org/mongo-driver/v2/event" "go.mongodb.org/mongo-driver/v2/internal/integtest" "go.mongodb.org/mongo-driver/v2/internal/serverselector" "go.mongodb.org/mongo-driver/v2/mongo/writeconcern" "go.mongodb.org/mongo-driver/v2/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/v2/x/mongo/driver" "go.mongodb.org/mongo-driver/v2/x/mongo/driver/operation" - "go.mongodb.org/mongo-driver/v2/x/mongo/driver/topology" ) -func setUpMonitor() (*event.CommandMonitor, chan *event.CommandStartedEvent, chan *event.CommandSucceededEvent, chan *event.CommandFailedEvent) { - started := make(chan *event.CommandStartedEvent, 1) - succeeded := make(chan *event.CommandSucceededEvent, 1) - failed := make(chan *event.CommandFailedEvent, 1) - - return &event.CommandMonitor{ - Started: func(ctx context.Context, e *event.CommandStartedEvent) { - started <- e - }, - Succeeded: func(ctx context.Context, e *event.CommandSucceededEvent) { - succeeded <- e - }, - Failed: func(ctx context.Context, e *event.CommandFailedEvent) { - failed <- e - }, - }, started, succeeded, failed -} - -func skipIfBelow32(ctx context.Context, t *testing.T, topo *topology.Topology) { - server, err := topo.SelectServer(ctx, &serverselector.Write{}) - noerr(t, err) - - versionCmd := bsoncore.BuildDocument(nil, bsoncore.AppendInt32Element(nil, "serverStatus", 1)) - serverStatus, err := runCommand(server, dbName, versionCmd) - noerr(t, err) - version, err := serverStatus.LookupErr("version") - noerr(t, err) - - if integtest.CompareVersions(t, version.StringValue(), "3.2") < 0 { - t.Skip() - } -} - func TestAggregate(t *testing.T) { if testing.Short() { t.Skip("skipping integration test in short mode") @@ -128,15 +93,3 @@ func TestAggregate(t *testing.T) { }) } - -func clearChannels(s chan *event.CommandStartedEvent, succ chan *event.CommandSucceededEvent, f chan *event.CommandFailedEvent) { - for len(s) > 0 { - <-s - } - for len(succ) > 0 { - <-succ - } - for len(f) > 0 { - <-f - } -}