Skip to content

Commit

Permalink
Get types lining up
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat15 committed Sep 12, 2024
1 parent 25422a8 commit 5fd005a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions internal/services/v1/experimental_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ func TestBulkExportRelationships(t *testing.T) {

resp, err := writer.CloseAndRecv()
require.NoError(t, err)
require.Equal(t, totalToWrite, resp.NumLoaded)
numLoaded, err := safecast.ToInt(resp.NumLoaded)
require.NoError(t, err)
require.Equal(t, totalToWrite, numLoaded)

testCases := []struct {
batchSize uint32
Expand All @@ -205,7 +207,7 @@ func TestBulkExportRelationships(t *testing.T) {
t.Run(fmt.Sprintf("%d-%d", tc.batchSize, tc.paginateEveryN), func(t *testing.T) {
require := require.New(t)

var totalRead uint64
var totalRead int
remainingRels := expectedRels.Copy()
require.Equal(totalToWrite, expectedRels.Size())
var cursor *v1.Cursor
Expand Down Expand Up @@ -233,7 +235,7 @@ func TestBulkExportRelationships(t *testing.T) {
require.NotEmpty(batch.AfterResultCursor.Token)

cursor = batch.AfterResultCursor
totalRead += uint64(len(batch.Relationships))
totalRead += len(batch.Relationships)

for _, rel := range batch.Relationships {
remainingRels.Remove(tuple.MustStringRelationship(rel))
Expand Down Expand Up @@ -354,7 +356,7 @@ func TestBulkExportRelationshipsWithFilter(t *testing.T) {
_, err = writer.CloseAndRecv()
require.NoError(err)

var totalRead int
var totalRead uint64
remainingRels := expectedRels.Copy()
var cursor *v1.Cursor

Expand Down Expand Up @@ -383,7 +385,7 @@ func TestBulkExportRelationshipsWithFilter(t *testing.T) {
require.NotEmpty(batch.AfterResultCursor.Token)

cursor = batch.AfterResultCursor
totalRead += len(batch.Relationships)
totalRead += uint64(len(batch.Relationships))

for _, rel := range batch.Relationships {
if tc.filter != nil {
Expand All @@ -400,7 +402,9 @@ func TestBulkExportRelationshipsWithFilter(t *testing.T) {
cancel()
}

require.Equal(tc.expectedCount, totalRead, "found: %v", foundRels.AsSlice())
// These are statically defined.
expectedCount, _ := safecast.ToUint64(tc.expectedCount)
require.Equal(expectedCount, totalRead, "found: %v", foundRels.AsSlice())
require.True(remainingRels.IsEmpty(), "rels were not exported %#v", remainingRels.List())
})
}
Expand Down

0 comments on commit 5fd005a

Please sign in to comment.