mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix(coderd): remove troublesome test case (#9874)
This commit is contained in:
@@ -159,15 +159,23 @@ func Test_parseInsightsInterval_week(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
now := time.Now()
|
||||
t.Logf("now: %s", now)
|
||||
|
||||
y, m, d := now.Date()
|
||||
today := time.Date(y, m, d, 0, 0, 0, 0, sydneyLoc)
|
||||
t.Logf("today: %s", today)
|
||||
|
||||
thisHour := time.Date(y, m, d, now.Hour(), 0, 0, 0, sydneyLoc)
|
||||
t.Logf("thisHour: %s", thisHour)
|
||||
twoHoursAgo := thisHour.Add(-2 * time.Hour)
|
||||
t.Logf("twoHoursAgo: %s", twoHoursAgo)
|
||||
thirteenDaysAgo := today.AddDate(0, 0, -13)
|
||||
t.Logf("thirteenDaysAgo: %s", thirteenDaysAgo)
|
||||
|
||||
sixDaysAgo := today.AddDate(0, 0, -6)
|
||||
t.Logf("sixDaysAgo: %s", sixDaysAgo)
|
||||
nineDaysAgo := today.AddDate(0, 0, -9)
|
||||
t.Logf("nineDaysAgo: %s", nineDaysAgo)
|
||||
|
||||
type args struct {
|
||||
startTime string
|
||||
@@ -186,14 +194,6 @@ func Test_parseInsightsInterval_week(t *testing.T) {
|
||||
},
|
||||
wantOk: true,
|
||||
},
|
||||
{
|
||||
name: "Two weeks",
|
||||
args: args{
|
||||
startTime: thirteenDaysAgo.Format(layout),
|
||||
endTime: twoHoursAgo.Format(layout),
|
||||
},
|
||||
wantOk: true,
|
||||
},
|
||||
{
|
||||
name: "One full week",
|
||||
args: args{
|
||||
|
||||
Reference in New Issue
Block a user