Skip to content

Commit

Permalink
Update tests for v0.2 (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
flanakin committed Mar 27, 2024
1 parent bf40586 commit 8334450
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
9 changes: 6 additions & 3 deletions docs-wiki/Release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,13 @@ Once the above requirements have been met, the feature branch can be merged into
- ZIP file for sample data files.
- **DO NOT** copy Bicep, PowerShell, PBIP, or image files.
8. Update the related discussion.
9. Update all issues to `Status: Released`.
10. Update the download test to include any new files/versions.
9. Update all issues to `Status: Released`.
10. Update the `Toolkit / Should return all known releases` PowerShell integration test based on the latest version.

> _See `FinOpsToolkit.Tests.ps1` > `Verify against prod GitHub`_
> _See `src/powershell/Tests/Integration/Toolkit.Tests.ps1` > `Get-FinOpsToolkitVersion` > `Should return all known releases`_
1. Add the latest public version to the `$expected` variable.
2. Update the file checks to include/exclude any new/removed files.

<br>

Expand Down
23 changes: 20 additions & 3 deletions src/powershell/Tests/Integration/Toolkit.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Describe 'Get-FinOpsToolkitVersion' {
It 'Should return all known releases' {
# Arrange
$expected = @('0.1.1', '0.1', '0.0.1')
$expected = @('0.2', '0.1.1', '0.1', '0.0.1')

# Act
$result = Get-FinOpsToolkitVersion
Expand All @@ -22,15 +22,32 @@ Describe 'Get-FinOpsToolkitVersion' {
$_.Files.Name | Should -Contain "optimization-workbook-v$ver.zip"
$_.Files.Name | Should -Contain "CostSummary.pbix"
$_.Files.Name | Should -Contain "CommitmentDiscounts.pbix"

# 0.1 and above
if ([version]$_.Version -ge [version]'0.1')
{
$_.Files.Name | Should -Contain "governance-workbook-v$ver.zip"
$_.Files.Name | Should -Contain "FOCUS.pbix"
$_.Files.Name | Should -Contain "PricingUnits.csv"
$_.Files.Name | Should -Contain "Regions.csv"
$_.Files.Name | Should -Contain "Services.csv"

# 0.1.*
if ([version]$_.Version -lt [version]'0.2')
{
$_.Files.Name | Should -Contain "FOCUS.pbix"
}
}

# 0.2 and above
if ([version]$_.Version -ge [version]'0.2')
{
$_.Files.Name | Should -Contain "CommitmentDiscounts.pbit"
$_.Files.Name | Should -Contain "CostManagementConnector.pbix"
$_.Files.Name | Should -Contain "CostManagementTemplateApp.pbix"
$_.Files.Name | Should -Contain "CostSummary.pbit"
$_.Files.Name | Should -Contain "ResourceTypes.csv"
$_.Files.Name | Should -Contain "ResourceTypes.json"
$_.Files.Name | Should -Contain "sample-exports.zip"
}
}
}
Expand Down

0 comments on commit 8334450

Please sign in to comment.