Skip to content

Bugfix for ContainerRegistry repository Install-PSResource with varying digit version #1796

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

Merged
merged 9 commits into from
Feb 27, 2025
Prev Previous commit
Next Next commit
add -TrustRepository to install tests
  • Loading branch information
anamnavi committed Feb 18, 2025
commit 35c9f946f4564d1a5330bfe5182f351aaaed2622
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,31 @@ Describe 'Test Install-PSResource for ACR scenarios' -tags 'CI' {

It "Install resource when version contains different number of digits than the normalized version- 1 digit specified" {
# the resource has version "1.0", but querying with any equivalent version should work
Install-PSResource -Name $testModuleWith2DigitVersion -Version "1" -Repository $ACRRepoName
Install-PSResource -Name $testModuleWith2DigitVersion -Version "1" -Repository $ACRRepoName -TrustRepository
$res = Get-InstalledPSResource -Name $testModuleWith2DigitVersion
$res | Should -Not -BeNullOrEmpty
$res.Version | Should -Be "1.0"
}

It "Install resource when version contains different number of digits than the normalized version- 2 digits specified" {
# the resource has version "1.0", but querying with any equivalent version should work
Install-PSResource -Name $testModuleWith2DigitVersion -Version "1.0" -Repository $ACRRepoName
Install-PSResource -Name $testModuleWith2DigitVersion -Version "1.0" -Repository $ACRRepoName -TrustRepository
$res = Get-InstalledPSResource -Name $testModuleWith2DigitVersion
$res | Should -Not -BeNullOrEmpty
$res.Version | Should -Be "1.0"
}

It "Install resource when version contains different number of digits than the normalized version- 3 digits specified" {
# the resource has version "1.0", but querying with any equivalent version should work
Install-PSResource -Name $testModuleWith2DigitVersion -Version "1.0.0" -Repository $ACRRepoName
Install-PSResource -Name $testModuleWith2DigitVersion -Version "1.0.0" -Repository $ACRRepoName -TrustRepository
$res = Get-InstalledPSResource -Name $testModuleWith2DigitVersion
$res | Should -Not -BeNullOrEmpty
$res.Version | Should -Be "1.0"
}

It "Install resource when version contains different number of digits than the normalized version- 4 digits specified" {
# the resource has version "1.0", but querying with any equivalent version should work
Install-PSResource -Name $testModuleWith2DigitVersion -Version "1.0.0.0" -Repository $ACRRepoName
Install-PSResource -Name $testModuleWith2DigitVersion -Version "1.0.0.0" -Repository $ACRRepoName -TrustRepository
$res = Get-InstalledPSResource -Name $testModuleWith2DigitVersion
$res | Should -Not -BeNullOrEmpty
$res.Version | Should -Be "1.0"
Expand Down