Skip to content

Commit 3a54eac

Browse files
committed
fix tests
1 parent 9e74cc1 commit 3a54eac

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

internal/verifier/change_stream_test.go

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/10gen/migration-verifier/mslices"
1212
"github.com/pkg/errors"
1313
"github.com/samber/lo"
14+
"github.com/stretchr/testify/assert"
1415
"github.com/stretchr/testify/require"
1516
"go.mongodb.org/mongo-driver/bson"
1617
"go.mongodb.org/mongo-driver/bson/primitive"
@@ -22,19 +23,24 @@ import (
2223
func TestChangeStreamFilter(t *testing.T) {
2324
verifier := Verifier{}
2425
verifier.SetMetaDBName("metadb")
25-
require.Equal(t, []bson.D{{{"$match", bson.D{{"ns.db", bson.D{{"$ne", "metadb"}}}}}}},
26-
verifier.GetChangeStreamFilter())
26+
assert.Contains(t,
27+
verifier.GetChangeStreamFilter(),
28+
bson.D{
29+
{"$match", bson.D{{"ns.db", bson.D{{"$ne", "metadb"}}}}},
30+
},
31+
)
2732
verifier.srcNamespaces = []string{"foo.bar", "foo.baz", "test.car", "test.chaz"}
28-
require.Equal(t, []bson.D{
29-
{{"$match", bson.D{
30-
{"$or", bson.A{
31-
bson.D{{"ns", bson.D{{"db", "foo"}, {"coll", "bar"}}}},
32-
bson.D{{"ns", bson.D{{"db", "foo"}, {"coll", "baz"}}}},
33-
bson.D{{"ns", bson.D{{"db", "test"}, {"coll", "car"}}}},
34-
bson.D{{"ns", bson.D{{"db", "test"}, {"coll", "chaz"}}}},
33+
assert.Contains(t,
34+
verifier.GetChangeStreamFilter(),
35+
bson.D{{"$match", bson.D{
36+
{"$or", []bson.D{
37+
{{"ns", bson.D{{"db", "foo"}, {"coll", "bar"}}}},
38+
{{"ns", bson.D{{"db", "foo"}, {"coll", "baz"}}}},
39+
{{"ns", bson.D{{"db", "test"}, {"coll", "car"}}}},
40+
{{"ns", bson.D{{"db", "test"}, {"coll", "chaz"}}}},
3541
}},
3642
}}},
37-
}, verifier.GetChangeStreamFilter())
43+
)
3844
}
3945

4046
// TestChangeStreamResumability creates a verifier, starts its change stream,

internal/verifier/migration_verifier_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ func (suite *IntegrationTestSuite) TestBackgroundInIndexSpec() {
15361536
verifier.SetNamespaceMap()
15371537

15381538
runner := RunVerifierCheck(ctx, suite.T(), verifier)
1539-
runner.AwaitGenerationEnd()
1539+
suite.Require().NoError(runner.AwaitGenerationEnd())
15401540

15411541
status, err := verifier.GetVerificationStatus()
15421542
suite.Require().NoError(err)

0 commit comments

Comments
 (0)