-
Notifications
You must be signed in to change notification settings - Fork 390
Fix time range tests by aligning assertions with timezone #13237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix time range tests by aligning assertions with timezone #13237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes flaky time-range tests by correcting timezone handling in date comparisons. The tests were incorrectly comparing UI wall-clock times (user timezone) with API payloads (UTC), causing failures in CI.
Key Changes:
- Modified
getThisMonthRange()andgetLastMonthRange()functions to accept a timezone parameter and properly convert to UTC - Changed mock profile timezone from 'UTC' to 'America/New_York' to test timezone conversion logic
- Updated test assertions to use the mock profile's timezone when generating expected date ranges
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/manager/cypress/e2e/core/cloudpulse/timerange-verification.spec.ts | Refactored date range functions to accept timezone parameter and convert to UTC; updated mock profile timezone and test calls |
| packages/manager/.changeset/pr-13237-tests-1767269372512.md | Added changeset documenting the test fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…m/agorthi-akamai/manager into timezone-bugfix_linode_January_01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/manager/cypress/e2e/core/cloudpulse/timerange-verification.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| isStart: boolean = false | ||
| ) => { | ||
| const now = DateTime.now().setZone('GMT'); // Set the timezone to GMT | ||
| const now = DateTime.now().setZone(timezone); // Set the timezone to GMT |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment 'Set the timezone to GMT' is outdated. It should be updated to reflect that the timezone is now configurable and set to 'America/New_York'.
| timezone, | ||
| }); | ||
| /** | ||
| * Generates a date in Indian Standard Time (IST) based on a specified number of days offset, |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function documentation mentions 'Indian Standard Time (IST)' but the function now uses a configurable timezone (America/New_York). The docstring should be updated to reflect this change.
Cloud Manager UI test results🎉 870 passing tests on test run #6 ↗︎
|
Description 📝
This change fixes flaky time-range tests by correcting how date and time values are validated.
The tests were incorrectly comparing UI wall-clock times (user timezone) with API payloads (UTC), which caused consistent failures in CI and incorrect assumptions about application behavior.
Changes 🔄
List any change(s) relevant to the reviewer.
-Removed invalid UI-to-UTC time comparisons.
Updated preset tests (This Month, Last Month, custom ranges) to asser
How to test 🧪
pnpm cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts,cypress/e2e/core/cloudpulse/timerange-verification.spec.ts"
Prerequisites
(How to setup test environment)
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support