Skip to content

Commit

Permalink
Add unit test for cassandra workflow utils part-3 (cadence-workflow#5506
Browse files Browse the repository at this point in the history
)
  • Loading branch information
taylanisikdemir authored Dec 21, 2023
1 parent 7b78949 commit ed873b8
Show file tree
Hide file tree
Showing 3 changed files with 1,151 additions and 15 deletions.
20 changes: 10 additions & 10 deletions common/persistence/nosql/nosqlplugin/cassandra/workflow_cql.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const (
`}`

templateActivityInfoType = `{` +
`version: ?,` +
`version: ?, ` +
`schedule_id: ?, ` +
`scheduled_event_batch_id: ?, ` +
`scheduled_event: ?, ` +
Expand Down Expand Up @@ -172,7 +172,7 @@ const (
`}`

templateTimerInfoType = `{` +
`version: ?,` +
`version: ?, ` +
`timer_id: ?, ` +
`started_id: ?, ` +
`expiry_time: ?, ` +
Expand Down Expand Up @@ -220,10 +220,10 @@ const (
`}`

templateUpdateCurrentWorkflowExecutionQuery = `UPDATE executions USING TTL 0 ` +
`SET current_run_id = ?,
execution = {run_id: ?, create_request_id: ?, state: ?, close_status: ?},
workflow_last_write_version = ?,
workflow_state = ? ` +
`SET current_run_id = ?, ` +
`execution = {run_id: ?, create_request_id: ?, state: ?, close_status: ?}, ` +
`workflow_last_write_version = ?, ` +
`workflow_state = ? ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand Down Expand Up @@ -333,7 +333,7 @@ workflow_state = ? ` +
`IF next_event_id = ? `

templateUpdateActivityInfoQuery = `UPDATE executions ` +
`SET activity_map[ ? ] =` + templateActivityInfoType + ` ` +
`SET activity_map[ ? ] = ` + templateActivityInfoType + ` ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand All @@ -343,7 +343,7 @@ workflow_state = ? ` +
`and task_id = ? `

templateResetActivityInfoQuery = `UPDATE executions ` +
`SET activity_map = ?` +
`SET activity_map = ? ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand All @@ -353,7 +353,7 @@ workflow_state = ? ` +
`and task_id = ? `

templateUpdateTimerInfoQuery = `UPDATE executions ` +
`SET timer_map[ ? ] =` + templateTimerInfoType + ` ` +
`SET timer_map[ ? ] = ` + templateTimerInfoType + ` ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand All @@ -363,7 +363,7 @@ workflow_state = ? ` +
`and task_id = ? `

templateResetTimerInfoQuery = `UPDATE executions ` +
`SET timer_map = ?` +
`SET timer_map = ? ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ func mustConvertToSlice(value interface{}) []interface{} {
}
return result
default:
panic(fmt.Sprintf("Unable to convert %v to slice", value))
panic(fmt.Sprintf("Unable to convert %v to slice which is of type %T", value, value))
}
}

Expand Down
Loading

0 comments on commit ed873b8

Please sign in to comment.