• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

redhat-performance / cloud-governance / 29033759278
73%

Build:
DEFAULT BRANCH: main
Ran 09 Jul 2026 04:44PM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
29033759278

push

travis-pro

web-flow
Fix AWS Cost Explorer ValidationException for queries >14 months  (#1011)

* Fix AWS Cost Explorer ValidationException for queries >14 months

AWS Cost Explorer requires start_date to be the first day of the month when
querying data beyond the past 14 months. This fix automatically adjusts the
start_date to the first day of the month when the date range exceeds 14 months.

Error fixed:
"To retrieve data beyond the past 14 months, your start date needs to be
the first day of the month."

Changes:
- Calculate months difference between start and end dates
- Auto-adjust start_date to first day of month if >14 months and not already first day
- Log adjustment for visibility
- Prevents CRO report failures for long-term historical cost queries

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add comprehensive unit tests for AWS Cost Explorer date adjustment

Added 7 unit tests to validate the >14 month date adjustment logic:
- test_get_cost_and_usage_within_14_months: Verifies no adjustment for <14 month queries
- test_get_cost_and_usage_beyond_14_months_adjusts_date: Tests mid-month date is adjusted to first day
- test_get_cost_and_usage_beyond_14_months_already_first_day: Verifies no change when already first day
- test_get_cost_and_usage_exactly_14_months: Boundary test for exactly 14 months
- test_get_cost_and_usage_15_months_triggers_adjustment: Tests 15-month query triggers adjustment
- test_get_cost_and_usage_with_pagination: Validates adjustment works with paginated results
- test_get_cost_and_usage_error_handling: Ensures graceful error handling with adjustment logic

All tests use mocked boto3 client to avoid actual AWS API calls.
All 7 tests pass successfully.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Harden cost_explorer unit tests

- Drop unused datetime import
- Inject mocked ce_client via the constructor instead of patching the
  boto3 module, decoupling tests from CostExplorerOperations internals
- Add regression test documenting... (continued)
Source Files on build 29033759278
Detailed source file information is not available for this build.
  • Back to Repo
  • 2614dfe0 on github
  • Prev Build on main (#29026084682)
  • Next Build on main (#29923280304)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc