Skip to content

Commit 101df47

Browse files
test: add tests with different timezones
1 parent 0643747 commit 101df47

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

coderd/prebuilds/preset_snapshot_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,26 @@ func TestCalculateDesiredInstances(t *testing.T) {
12251225
at: mustParseTime(t, time.RFC1123, "Mon, 02 Jun 2025 23:00:00 UTC"),
12261226
expectedCalculatedInstances: 1,
12271227
},
1228+
1229+
// Verify support for time values specified in non-UTC time zones.
1230+
{
1231+
name: "8AM - before the start of the time range",
1232+
snapshot: mkSnapshot(
1233+
mkPreset(1, "UTC"),
1234+
mkSchedule("* 9-18 * * 1-5", 3),
1235+
),
1236+
at: mustParseTime(t, time.RFC1123Z, "Mon, 02 Jun 2025 04:00:00 -0400"),
1237+
expectedCalculatedInstances: 1,
1238+
},
1239+
{
1240+
name: "9AM - after the start of the time range",
1241+
snapshot: mkSnapshot(
1242+
mkPreset(1, "UTC"),
1243+
mkSchedule("* 9-18 * * 1-5", 3),
1244+
),
1245+
at: mustParseTime(t, time.RFC1123Z, "Mon, 02 Jun 2025 05:00:00 -0400"),
1246+
expectedCalculatedInstances: 3,
1247+
},
12281248
}
12291249

12301250
for _, tc := range testCases {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy