1057
}
1058
1059
>
func (s *visibilitySuite) TestSelect_MinStartTime_MaxStartTime_StatusClose_Single() {
visibility.go
1060
>
for _, status := range testVisibilityCloseStatus {
1061
>
s.testSelectMinStartTimeMaxStartTimeStatusCloseSingle(status)
1062
>
}
1063
}
1064
1065
func (s *visibilitySuite) testSelectMinStartTimeMaxStartTimeStatusCloseSingle(
1066
status enumspb.WorkflowExecutionStatus,
1068
>
pageSize := 1
1069
>
1070
>
namespaceID := primitives.NewUUID()
1071
>
runID := primitives.NewUUID()
1072
>
workflowTypeName := shuffle.String(testVisibilityWorkflowTypeName)
1073
>
workflowID := shuffle.String(testVisibilityWorkflowID)
1074
>
startTime := s.now()
1075
>
executionTime := startTime.Add(time.Second)
1076
>
closeTime := executionTime.Add(time.Second)
1077
>
historyLength := rand.Int63()
1078
>
1079
>
visibility := s.newRandomVisibilityRow(
1080
>
namespaceID,
1081
>
runID,
1082
>
workflowTypeName,
1083
>
workflowID,
1084
>
startTime,
1085
>
executionTime,
1086
>
int32(status),
1087
>
new(closeTime),
1088
>
new(historyLength),
1089
>
)
1090
>
result, err := s.store.ReplaceIntoVisibility(newVisibilityContext(), &visibility)
1091
>
s.NoError(err)
1092
>
rowsAffected, err := result.RowsAffected()
1093
>
s.NoError(err)
1094
>
s.Equal(1, int(rowsAffected))
1095
>
1096
>
minStartTime := closeTime
1097
>
maxStartTime := closeTime
1098
>
selectFilter := sqlplugin.VisibilitySelectFilter{
1099
>
NamespaceID: namespaceID.String(),
1100
>
WorkflowID: nil,
1101
>
RunID: new(""),
1102
>
WorkflowTypeName: nil,
1103
>
MinTime: new(minStartTime),
1104
>
MaxTime: new(maxStartTime),
1105
>
Status: int32(enumspb.WORKFLOW_EXECUTION_STATUS_UNSPECIFIED),
1106
>
PageSize: new(pageSize),
1107
>
}
1108
>
rows, err := s.store.SelectFromVisibility(newVisibilityContext(), selectFilter)
1109
>
s.NoError(err)
1110
>
for index := range rows {
1111
>
rows[index].NamespaceID = namespaceID.String()
1112
>
}
1113
>
s.Equal([]sqlplugin.VisibilityRow{visibility}, rows)
1114
}
1115