Skip to content

Commit

Permalink
Remove unused functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdale committed Jul 31, 2024
1 parent bb92cfe commit 40c3d54
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions x/mongo/driver/integration/aggregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
}
}

0 comments on commit 40c3d54

Please sign in to comment.