From d06e376814152f6b12c7c9dc0c51ebe7da45db75 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 Jun 2021 17:28:27 +0000 Subject: [PATCH 1/2] Add 500 to revision of GA releases --- PowerShell.Common.props | 4 +++- test/packaging/windows/msi.tests.ps1 | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index b6b627bdf34..cbfc342851b 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -49,13 +49,15 @@ $([System.Text.RegularExpressions.Regex]::Match($(ReleaseTag), $(RegexReleaseTag)).Groups[6].Value) 100 + + 500 $([MSBuild]::Add($(ReleaseTagSemVersionPart), $(RCIncrementValue))) $(ReleaseTag) $(ReleaseTagVersionPart).$(ReleaseTagSemVersionPart) - $(ReleaseTagVersionPart) + $(ReleaseTagVersionPart).$(GAIncrementValue) diff --git a/test/packaging/windows/msi.tests.ps1 b/test/packaging/windows/msi.tests.ps1 index 19df125691b..48e3efc0d5e 100644 --- a/test/packaging/windows/msi.tests.ps1 +++ b/test/packaging/windows/msi.tests.ps1 @@ -85,17 +85,26 @@ Describe -Name "Windows MSI" -Fixture { Context "Upgrade code" { BeforeAll { Write-Verbose "cr-$channel-$runtime" -Verbose + $pwshPath = Join-Path $env:ProgramFiles -ChildPath "PowerShell" switch ("$channel-$runtime") { "preview-win7-x64" { + $versionPath = Join-Path -Path $pwshPath -ChildPath '7-preview' + $revisionRange = 0, 99 $msiUpgradeCode = '39243d76-adaf-42b1-94fb-16ecf83237c8' } "stable-win7-x64" { + $versionPath = Join-Path -Path $pwshPath -ChildPath '7' + $revisionRange = 500, 500 $msiUpgradeCode = '31ab5147-9a97-4452-8443-d9709f0516e1' } "preview-win7-x86" { + $versionPath = Join-Path -Path $pwshPath -ChildPath '7-preview' + $revisionRange = 0, 99 $msiUpgradeCode = '86abcfbd-1ccc-4a88-b8b2-0facfde29094' } "stable-win7-x86" { + $versionPath = Join-Path -Path $pwshPath -ChildPath '7' + $revisionRange = 500, 500 $msiUpgradeCode = '1d00683b-0f84-4db8-a64f-2f98ad42fe06' } default { @@ -120,6 +129,13 @@ Describe -Name "Windows MSI" -Fixture { $result.Count | Should -Be 1 -Because "Query should return 1 result if Upgrade code is for $runtime $channel" } + It "Revision should be in correct range" -Skip:(!(Test-Elevated)) { + $pwshDllPath = Join-Path -Path $versionPath -ChildPath "pwsh.dll" + [version] $version = (Get-ChildItem $pwshDllPath).VersionInfo.FileVersion + $version.Revision | Should -BeGreaterOrEqual $revisionRange[0] -Because "$channel revision should between $($revisionRange[0]) and $($revisionRange[1])" + $version.Revision | Should -BeLessOrEqual $revisionRange[1] -Because "$channel revision should between $($revisionRange[0]) and $($revisionRange[1])" + } + It "MSI should uninstall without error" -Skip:(!(Test-Elevated)) { { Invoke-MsiExec -Uninstall -MsiPath $msiX64Path From 3b063d5ea70566ff132e73d0aba4d9f13ef0a4a0 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 Jun 2021 18:03:38 +0000 Subject: [PATCH 2/2] Fix issues found in test run --- test/packaging/windows/msi.tests.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/packaging/windows/msi.tests.ps1 b/test/packaging/windows/msi.tests.ps1 index 48e3efc0d5e..d58357a1cd1 100644 --- a/test/packaging/windows/msi.tests.ps1 +++ b/test/packaging/windows/msi.tests.ps1 @@ -86,6 +86,8 @@ Describe -Name "Windows MSI" -Fixture { BeforeAll { Write-Verbose "cr-$channel-$runtime" -Verbose $pwshPath = Join-Path $env:ProgramFiles -ChildPath "PowerShell" + $pwshx86Path = Join-Path ${env:ProgramFiles(x86)} -ChildPath "PowerShell" + switch ("$channel-$runtime") { "preview-win7-x64" { $versionPath = Join-Path -Path $pwshPath -ChildPath '7-preview' @@ -98,12 +100,12 @@ Describe -Name "Windows MSI" -Fixture { $msiUpgradeCode = '31ab5147-9a97-4452-8443-d9709f0516e1' } "preview-win7-x86" { - $versionPath = Join-Path -Path $pwshPath -ChildPath '7-preview' + $versionPath = Join-Path -Path $pwshx86Path -ChildPath '7-preview' $revisionRange = 0, 99 $msiUpgradeCode = '86abcfbd-1ccc-4a88-b8b2-0facfde29094' } "stable-win7-x86" { - $versionPath = Join-Path -Path $pwshPath -ChildPath '7' + $versionPath = Join-Path -Path $pwshx86Path -ChildPath '7' $revisionRange = 500, 500 $msiUpgradeCode = '1d00683b-0f84-4db8-a64f-2f98ad42fe06' } @@ -132,6 +134,7 @@ Describe -Name "Windows MSI" -Fixture { It "Revision should be in correct range" -Skip:(!(Test-Elevated)) { $pwshDllPath = Join-Path -Path $versionPath -ChildPath "pwsh.dll" [version] $version = (Get-ChildItem $pwshDllPath).VersionInfo.FileVersion + Write-Verbose "pwsh.dll version: $version" -Verbose $version.Revision | Should -BeGreaterOrEqual $revisionRange[0] -Because "$channel revision should between $($revisionRange[0]) and $($revisionRange[1])" $version.Revision | Should -BeLessOrEqual $revisionRange[1] -Because "$channel revision should between $($revisionRange[0]) and $($revisionRange[1])" }