diff --git a/pkg/ppm/bounds.go b/pkg/ppm/bounds.go index acb8add..99defbf 100644 --- a/pkg/ppm/bounds.go +++ b/pkg/ppm/bounds.go @@ -118,5 +118,6 @@ func convertToDateTimeWithoutTimezone(bound time.Time) time.Time { if err != nil { return time.Time{} } + return parsedTime } diff --git a/pkg/ppm/checkpartition_test.go b/pkg/ppm/checkpartition_test.go index 2bfdea9..143c6c0 100644 --- a/pkg/ppm/checkpartition_test.go +++ b/pkg/ppm/checkpartition_test.go @@ -51,12 +51,15 @@ func TestCheckPartitions(t *testing.T) { // Build mock for each partitions for _, p := range partitions { - var tables []partition.Partition - var retentionTables []partition.Partition - var preprovisionedTables []partition.Partition + var ( + tables []partition.Partition + retentionTables []partition.Partition + preprovisionedTables []partition.Partition + ) // Create retention partitions forDate := time.Now() + switch p.Interval { case partition.Daily: retentionTables, _ = p.GetRetentionPartitions(forDate) @@ -71,6 +74,7 @@ func TestCheckPartitions(t *testing.T) { default: t.Errorf("unuspported partition interval in retention table mock") } + tables = append(tables, retentionTables...) // Create current partition @@ -92,6 +96,7 @@ func TestCheckPartitions(t *testing.T) { default: t.Errorf("unuspported partition interval in preprovisonned table mock") } + tables = append(tables, preprovisionedTables...) postgreSQLMock.On("GetColumnDataType", p.Schema, p.Table, p.PartitionKey).Return(postgresql.Date, nil).Once()