Skip to content

Commit

Permalink
Fix unittest for 31st day of month of ES index (#5144)
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Yadav <[email protected]>
  • Loading branch information
vivek-yadav authored Jun 1, 2021
1 parent ab41288 commit 60a3fc0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ func TestGetEsIndexNoTimeLast24h(t *testing.T) {

today := todayTime.Format("2006.01.02")
if todayTime.Day() == 31 {
today = todayTime.Format("2006.01.")
//if it's the 31st, shave off the 1 and make it 3*, which will be the 30th and 31st
assert.Equal(t, sum+"-3*", index)
assert.Equal(t, sum+"-"+today+"3*", index)
} else {
yesterday := todayTime.Add(-24 * time.Hour).Format("2006.01.02")
assert.Equal(t, sum+"-"+yesterday+"*,"+sum+"-"+today+"*", index)
Expand Down

0 comments on commit 60a3fc0

Please sign in to comment.