Skip to content

Commit

Permalink
Upgrade Artie Transfer (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 authored May 9, 2024
1 parent f4e2e06 commit 74db570
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 45 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22

require (
github.com/DataDog/datadog-go v4.8.3+incompatible
github.com/artie-labs/transfer v1.25.2
github.com/artie-labs/transfer v1.25.4
github.com/aws/aws-sdk-go v1.44.327
github.com/aws/aws-sdk-go-v2 v1.18.1
github.com/aws/aws-sdk-go-v2/config v1.18.19
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ github.com/apache/thrift v0.0.0-20181112125854-24918abba929/go.mod h1:cp2SuWMxlE
github.com/apache/thrift v0.14.2/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.16.0 h1:qEy6UW60iVOlUy+b9ZR0d5WzUWYGOo4HfopoyBaNmoY=
github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
github.com/artie-labs/transfer v1.25.2 h1:erRFqFwHQa2whTk6qpsHTE6UT72ybK0Mj+H8K91Sw8k=
github.com/artie-labs/transfer v1.25.2/go.mod h1:cbshXx1+L+LAZ+38/VR30jiOUt01mXfk1yu4i9cBaCE=
github.com/artie-labs/transfer v1.25.4 h1:O70TA5i8Ds/hJZqksJ9/t6uJti8GPAVmkFR4gquUQ1I=
github.com/artie-labs/transfer v1.25.4/go.mod h1:cbshXx1+L+LAZ+38/VR30jiOUt01mXfk1yu4i9cBaCE=
github.com/aws/aws-sdk-go v1.30.19/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.44.327 h1:ZS8oO4+7MOBLhkdwIhgtVeDzCeWOlTfKJS7EgggbIEY=
github.com/aws/aws-sdk-go v1.44.327/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
Expand Down
42 changes: 0 additions & 42 deletions writers/transfer/writer_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package transfer

import (
"context"
"github.com/artie-labs/reader/lib"
"github.com/artie-labs/reader/lib/mocks"
"github.com/artie-labs/transfer/lib/cdc/util"
"testing"

transferCfg "github.com/artie-labs/transfer/lib/config"
Expand Down Expand Up @@ -52,41 +48,3 @@ func TestWriter_MessageToEvent(t *testing.T) {

assert.Equal(t, map[string]any{"_id": objId.Hex()}, evtOut.PrimaryKeyMap)
}

func TestWriter_Write(t *testing.T) {
var rawMsgs []lib.RawMessage
for range 100 {
rawMsgs = append(rawMsgs, lib.NewRawMessage(
"topic-suffix",
map[string]any{"key": "value"},
&util.SchemaEventPayload{
Payload: util.Payload{
After: map[string]any{"a": "b"},
Source: util.Source{
TsMs: 1000,
Table: "table",
},
Operation: "c",
},
},
))
}

writer, err := NewWriter(transferCfg.Config{
Mode: transferCfg.Replication,
Output: "test",
Kafka: &transferCfg.Kafka{
TopicConfigs: []*kafkalib.TopicConfig{
{
TableName: "table",
},
},
},
}, &mocks.FakeClient{})
assert.NoError(t, err)

assert.Nil(t, writer.primaryKeys)
assert.NoError(t, writer.Write(context.Background(), rawMsgs))
assert.Len(t, writer.primaryKeys, 1)
assert.Equal(t, "key", writer.primaryKeys[0])
}

0 comments on commit 74db570

Please sign in to comment.