@@ -25,6 +25,7 @@ import (
2525 "github.com/10gen/migration-verifier/internal/testutil"
2626 "github.com/10gen/migration-verifier/internal/types"
2727 "github.com/10gen/migration-verifier/internal/util"
28+ "github.com/10gen/migration-verifier/mbson"
2829 "github.com/10gen/migration-verifier/mslices"
2930 "github.com/cespare/permute/v2"
3031 "github.com/rs/zerolog"
@@ -543,7 +544,7 @@ func (suite *IntegrationTestSuite) TestVerifierFetchDocuments() {
543544 suite .Assert ().Regexp (regexp .MustCompile ("^" + Mismatch ), results [0 ].Details , "mismatch expected" )
544545 suite .Assert ().EqualValues (
545546 any (id ),
546- results [0 ].ID .(bson. RawValue ). AsInt64 (),
547+ results [0 ].ID .AsInt64 (),
547548 "mismatch recorded as expeceted" ,
548549 )
549550
@@ -562,7 +563,7 @@ func (suite *IntegrationTestSuite) TestVerifierFetchDocuments() {
562563 suite .Assert ().Regexp (regexp .MustCompile ("^" + Mismatch ), results [0 ].Details , "mismatch expeceted" )
563564 suite .Assert ().EqualValues (
564565 any (id ),
565- results [0 ].ID .(bson. RawValue ). AsInt64 (),
566+ results [0 ].ID .AsInt64 (),
566567 "mismatch recorded as expeceted" ,
567568 )
568569}
@@ -684,7 +685,7 @@ func (suite *IntegrationTestSuite) TestGetPersistedNamespaceStatistics_Recheck()
684685 events : []ParsedEvent {{
685686 OpType : "insert" ,
686687 Ns : & Namespace {DB : "mydb" , Coll : "coll2" },
687- DocID : "heyhey" ,
688+ DocID : mbson . ToRawValue ( "heyhey" ) ,
688689 ClusterTime : & primitive.Timestamp {
689690 T : uint32 (time .Now ().Unix ()),
690691 },
@@ -700,7 +701,7 @@ func (suite *IntegrationTestSuite) TestGetPersistedNamespaceStatistics_Recheck()
700701 events : []ParsedEvent {{
701702 OpType : "insert" ,
702703 Ns : & Namespace {DB : "mydb" , Coll : "coll1" },
703- DocID : "hoohoo" ,
704+ DocID : mbson . ToRawValue ( "hoohoo" ) ,
704705 ClusterTime : & primitive.Timestamp {
705706 T : uint32 (time .Now ().Unix ()),
706707 },
@@ -935,14 +936,29 @@ func (suite *IntegrationTestSuite) TestGetNamespaceStatistics_Gen0() {
935936func (suite * IntegrationTestSuite ) TestFailedVerificationTaskInsertions () {
936937 ctx := suite .Context ()
937938 verifier := suite .BuildVerifier ()
938- err := verifier .InsertFailedCompareRecheckDocs (ctx , "foo.bar" , []any {42 }, []int {100 })
939+ err := verifier .InsertFailedCompareRecheckDocs (
940+ ctx ,
941+ "foo.bar" ,
942+ mslices .Of (mbson .ToRawValue (42 )),
943+ []int {100 },
944+ )
939945 suite .Require ().NoError (err )
940- err = verifier .InsertFailedCompareRecheckDocs (ctx , "foo.bar" , []any {43 , 44 }, []int {100 , 100 })
946+ err = verifier .InsertFailedCompareRecheckDocs (
947+ ctx ,
948+ "foo.bar" ,
949+ mslices .Of (mbson .ToRawValue (43 ), mbson .ToRawValue (44 )),
950+ []int {100 , 100 },
951+ )
941952 suite .Require ().NoError (err )
942- err = verifier .InsertFailedCompareRecheckDocs (ctx , "foo.bar2" , []any {42 }, []int {100 })
953+ err = verifier .InsertFailedCompareRecheckDocs (
954+ ctx ,
955+ "foo.bar2" ,
956+ mslices .Of (mbson .ToRawValue (42 )),
957+ []int {100 },
958+ )
943959 suite .Require ().NoError (err )
944960 event := ParsedEvent {
945- DocID : int32 (55 ),
961+ DocID : mbson . ToRawValue ( int32 (55 ) ),
946962 OpType : "delete" ,
947963 Ns : & Namespace {
948964 DB : "foo" ,
@@ -1056,7 +1072,7 @@ func TestVerifierCompareDocs(t *testing.T) {
10561072 compareFn : func (t * testing.T , mismatchResults []VerificationResult ) {
10571073 if assert .Equal (t , 1 , len (mismatchResults )) {
10581074 var res int
1059- require .Nil (t , mismatchResults [0 ].ID .(bson. RawValue ). Unmarshal (& res ))
1075+ require .Nil (t , mismatchResults [0 ].ID .Unmarshal (& res ))
10601076 assert .Equal (t , id , res )
10611077 assert .Regexp (t , regexp .MustCompile ("^" + Mismatch ), mismatchResults [0 ].Details )
10621078 }
@@ -1074,7 +1090,7 @@ func TestVerifierCompareDocs(t *testing.T) {
10741090 compareFn : func (t * testing.T , mismatchResults []VerificationResult ) {
10751091 if assert .Equal (t , 1 , len (mismatchResults )) {
10761092 var res int
1077- require .Nil (t , mismatchResults [0 ].ID .(bson. RawValue ). Unmarshal (& res ))
1093+ require .Nil (t , mismatchResults [0 ].ID .Unmarshal (& res ))
10781094 assert .Equal (t , id , res )
10791095 assert .Regexp (t , regexp .MustCompile ("^" + Mismatch ), mismatchResults [0 ].Details )
10801096 }
@@ -1620,7 +1636,7 @@ func (suite *IntegrationTestSuite) TestVerifierCompareIndexes() {
16201636 failures = suite .getFailuresForTask (verifier , task .PrimaryKey )
16211637 if suite .Equal (2 , len (failures )) {
16221638 sort .Slice (failures , func (i , j int ) bool {
1623- return failures [i ].ID .( string ) < failures [j ].ID .( string )
1639+ return failures [i ].ID .StringValue ( ) < failures [j ].ID .StringValue ( )
16241640 })
16251641 suite .Equal (dstIndexNames [1 ], failures [0 ].ID )
16261642 suite .Equal (Missing , failures [0 ].Details )
0 commit comments