Added test

This commit is contained in:
ray chen 2025-11-26 00:59:46 +00:00 committed by azure-sdk
parent 621e2a905c
commit 8ba2425b96
2 changed files with 11 additions and 5 deletions

View File

@ -281,9 +281,9 @@ function Get-FullPackageName {
$groupId = $PackageInfo.Group
if ($groupId) {
if ($UseColonSeparator) {
return "${groupId}:$($PackageInfo.ArtifactName)"
return "${groupId}:$($PackageInfo.Name)"
}
return "${groupId}+$($PackageInfo.ArtifactName)"
return "${groupId}+$($PackageInfo.Name)"
}
}
return $PackageInfo.Name

View File

@ -241,6 +241,8 @@ function Get-PkgProperties {
[string]$GroupId
)
Write-Host "Get-PkgProperties called with PackageName: [$PackageName], ServiceDirectory: [$ServiceDirectory], GroupId: [$GroupId]"
$allPkgProps = Get-AllPkgProperties -ServiceDirectory $ServiceDirectory
if ([string]::IsNullOrEmpty($GroupId)) {
@ -249,8 +251,7 @@ function Get-PkgProperties {
else {
$pkgProps = $allPkgProps.Where({
($_.Name -eq $PackageName -or $_.ArtifactName -eq $PackageName) -and
$_.PSObject.Properties.Name -contains "Group" -and
$_.Group -eq $GroupId
($_.PSObject.Properties.Name -contains "Group" -and $_.Group -eq $GroupId)
});
}
@ -261,7 +262,12 @@ function Get-PkgProperties {
return $pkgProps[0]
}
LogError "Failed to retrieve Properties for [$PackageName]"
if ([string]::IsNullOrEmpty($GroupId)) {
LogError "Failed to retrieve Properties for [$PackageName]"
}
else {
LogError "Failed to retrieve Properties for [$PackageName] with GroupId [$GroupId]. Ensure the package has a Group property matching the specified GroupId."
}
return $null
}