Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6bf73a5

Browse files
authored
fix(coderd): move test location to ignore Australia time saving error (#15013)
A test is currently failing because it relies on Sidney Tz.from the internet : ```Daylight Saving Time begins at 2 am (AEST) on the first Sunday in October and ends at 3 am (Australian Eastern Daylight Time) on the first Sunday in April.```Due to that - there's one hour missing in the tests - and the test `6days are acceptable` is failing.Changing to another timezone to fix the situation, it would require alonger-term solution or making sure it cannot happen anymore.
1 parent3046f5c commit6bf73a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎coderd/insights_internal_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,17 @@ func Test_parseInsightsInterval_week(t *testing.T) {
179179
t.Parallel()
180180

181181
layout:=insightsTimeLayout
182-
sydneyLoc,err:=time.LoadLocation("Australia/Sydney")// Random location
182+
losAngelesLoc,err:=time.LoadLocation("America/Los_Angeles")// Random location
183183
require.NoError(t,err)
184184

185-
now:=time.Now().In(sydneyLoc)
185+
now:=time.Now().In(losAngelesLoc)
186186
t.Logf("now: %s",now)
187187

188188
y,m,d:=now.Date()
189-
today:=time.Date(y,m,d,0,0,0,0,sydneyLoc)
189+
today:=time.Date(y,m,d,0,0,0,0,losAngelesLoc)
190190
t.Logf("today: %s",today)
191191

192-
thisHour:=time.Date(y,m,d,now.Hour(),0,0,0,sydneyLoc)
192+
thisHour:=time.Date(y,m,d,now.Hour(),0,0,0,losAngelesLoc)
193193
t.Logf("thisHour: %s",thisHour)
194194
twoHoursAgo:=thisHour.Add(-2*time.Hour)
195195
t.Logf("twoHoursAgo: %s",twoHoursAgo)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp