Skip to content

Fix Start-FinOpsCostExport unit tests#1646

Merged
flanakin merged 2 commits into
devfrom
flanakin/dev/ps-startexp
May 30, 2025
Merged

Fix Start-FinOpsCostExport unit tests#1646
flanakin merged 2 commits into
devfrom
flanakin/dev/ps-startexp

Conversation

@flanakin

Copy link
Copy Markdown
Collaborator

🛠️ Description

Fix Start-FinOpsCostExport unit test and bug where the initial export fails during the backfill process

Fixes #988, #884

📋 Checklist

🔬 How did you test this change?

  • 🤏 Lint tests
  • 🤞 PS -WhatIf / az validate
  • 👍 Manually deployed + verified
  • 💪 Unit tests
  • 🙌 Integration tests

🙋‍♀️ Do any of the following that apply?

  • 🚨 This is a breaking change.
  • 🤏 The change is less than 20 lines of code.

📑 Did you update docs/changelog.md?

  • ✅ Updated changelog (required for dev PRs)
  • ➡️ Will add log in a future PR (feature branch PRs only)
  • ❎ Log not needed (small/internal change)

📖 Did you update documentation?

  • ✅ Public docs in docs (required for dev)
  • ✅ Internal dev docs in src (required for dev)
  • ➡️ Will add docs in a future PR (feature branch PRs only)
  • ❎ Docs not needed (small/internal change)

@flanakin flanakin added this to the 2025-05 - May milestone May 30, 2025
@flanakin flanakin requested a review from arthurclares as a code owner May 30, 2025 10:08
@microsoft-github-policy-service microsoft-github-policy-service Bot added Micro PR 🔬 Very small PR that should be especially easy for newcomers Needs: Review 👀 PR that is ready to be reviewed labels May 30, 2025
@flanakin flanakin enabled auto-merge (squash) May 30, 2025 10:10
@flanakin flanakin linked an issue May 30, 2025 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 the Start-FinOpsCostExport unit tests to use a consistent backfill date range, ensures UTC date normalization in the command, and refines the verbose log output.

  • Test changes: updated StartDate/EndDate in tests, added UTC date setup, and assertions for backfill Invoke-Rest calls
  • Command changes: normalized default StartDate to UTC midnight and enhanced the Write-Verbose message to include full ISO timestamps
  • Changelog updated with the new PowerShell module version entry

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/powershell/Tests/Unit/Start-FinOpsCostExport.Tests.ps1 Adjusted test date ranges, added $today and $startOfMonth in UTC, and backfill call assertions
src/powershell/Public/Start-FinOpsCostExport.ps1 Changed default StartDate normalization to .ToUniversalTime().Date and updated verbose logging format
docs-mslearn/toolkit/changelog.md Added PowerShell module v0.10 entry with Start-FinOpsCostExport fix

Comment thread src/powershell/Tests/Unit/Start-FinOpsCostExport.Tests.ps1
Comment thread src/powershell/Tests/Unit/Start-FinOpsCostExport.Tests.ps1
Comment thread src/powershell/Public/Start-FinOpsCostExport.ps1
Comment thread src/powershell/Public/Start-FinOpsCostExport.ps1
@flanakin flanakin merged commit 7cabb8e into dev May 30, 2025
5 checks passed
@flanakin flanakin deleted the flanakin/dev/ps-startexp branch May 30, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Micro PR 🔬 Very small PR that should be especially easy for newcomers Needs: Review 👀 PR that is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PowerShell] Start-FinOpsCostExport throws BadRequest error [PowerShell] Start-FinOpsCostExport error

4 participants