Skip to content

Commit

Permalink
Update some tests to use new internal column
Browse files Browse the repository at this point in the history
  • Loading branch information
danafallon committed Jul 16, 2024
1 parent 84463fd commit a7fcd5b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
46 changes: 26 additions & 20 deletions clients/snowflake/snowflake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ func (s *SnowflakeTestSuite) TestExecuteMergeNilEdgeCase() {
// TableData will think the column is invalid and tableConfig will think column = string
// Before we call merge, it should reconcile it.
colToKindDetailsMap := map[string]typing.KindDetails{
"id": typing.String,
"first_name": typing.String,
"invalid_column": typing.Invalid,
constants.DeleteColumnMarker: typing.Boolean,
"id": typing.String,
"first_name": typing.String,
"invalid_column": typing.Invalid,
constants.DeleteColumnMarker: typing.Boolean,
constants.OnlySetDeletedColumnMarker: typing.Boolean,
}

var cols columns.Columns
Expand Down Expand Up @@ -66,9 +67,10 @@ func (s *SnowflakeTestSuite) TestExecuteMergeNilEdgeCase() {
}

anotherColToKindDetailsMap := map[string]typing.KindDetails{
"id": typing.String,
"first_name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
"id": typing.String,
"first_name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
constants.OnlySetDeletedColumnMarker: typing.Boolean,
}

var anotherCols columns.Columns
Expand All @@ -87,9 +89,10 @@ func (s *SnowflakeTestSuite) TestExecuteMergeNilEdgeCase() {

func (s *SnowflakeTestSuite) TestExecuteMergeReestablishAuth() {
colToKindDetailsMap := map[string]typing.KindDetails{
"id": typing.Integer,
"name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
"id": typing.Integer,
"name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
constants.OnlySetDeletedColumnMarker: typing.Boolean,
// Add kindDetails to created_at
"created_at": typing.ParseValue(typing.Settings{}, "", nil, time.Now().Format(time.RFC3339Nano)),
}
Expand Down Expand Up @@ -134,9 +137,10 @@ func (s *SnowflakeTestSuite) TestExecuteMergeReestablishAuth() {

func (s *SnowflakeTestSuite) TestExecuteMerge() {
colToKindDetailsMap := map[string]typing.KindDetails{
"id": typing.Integer,
"name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
"id": typing.Integer,
"name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
constants.OnlySetDeletedColumnMarker: typing.Boolean,
// Add kindDetails to created_at
"created_at": typing.ParseValue(typing.Settings{}, "", nil, time.Now().Format(time.RFC3339Nano)),
}
Expand Down Expand Up @@ -223,9 +227,10 @@ func (s *SnowflakeTestSuite) TestExecuteMergeDeletionFlagRemoval() {
}

colToKindDetailsMap := map[string]typing.KindDetails{
"id": typing.Integer,
"name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
"id": typing.Integer,
"name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
constants.OnlySetDeletedColumnMarker: typing.Boolean,
// Add kindDetails to created_at
"created_at": typing.ParseValue(typing.Settings{}, "", nil, time.Now().Format(time.RFC3339Nano)),
}
Expand All @@ -242,10 +247,11 @@ func (s *SnowflakeTestSuite) TestExecuteMergeDeletionFlagRemoval() {
}

snowflakeColToKindDetailsMap := map[string]typing.KindDetails{
"id": typing.Integer,
"created_at": typing.NewKindDetailsFromTemplate(typing.ETime, ext.DateTimeKindType),
"name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
"id": typing.Integer,
"created_at": typing.NewKindDetailsFromTemplate(typing.ETime, ext.DateTimeKindType),
"name": typing.String,
constants.DeleteColumnMarker: typing.Boolean,
constants.OnlySetDeletedColumnMarker: typing.Boolean,
}

var sflkCols columns.Columns
Expand Down
11 changes: 6 additions & 5 deletions processes/consumer/flush_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ func (f *FlushTestSuite) TestMemoryConcurrency() {
"id": fmt.Sprintf("pk-%d", i),
},
Data: map[string]any{
"id": fmt.Sprintf("pk-%d", i),
constants.DeleteColumnMarker: true,
"pk": fmt.Sprintf("pk-%d", i),
"foo": "bar",
"cat": "dog",
"id": fmt.Sprintf("pk-%d", i),
constants.DeleteColumnMarker: true,
constants.OnlySetDeletedColumnMarker: true,
"pk": fmt.Sprintf("pk-%d", i),
"foo": "bar",
"cat": "dog",
},
}

Expand Down

0 comments on commit a7fcd5b

Please sign in to comment.