Skip to content
4 changes: 2 additions & 2 deletions Actions/CreateApp/CreateApp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ try {
$sampleApp = (Get-Item -Path $sampleApp).FullName
}
else {
$sampleApp = Join-Path $folders[1] "Applications\testframework\performancetoolkit\Microsoft_Performance Toolkit Samples.app"
$sampleApp = Get-ChildItem -Path $folders[1] -Filter "Microsoft_Performance Toolkit Samples.app" -Recurse | Select-Object -First 1 -ExpandProperty FullName
Comment thread
mazhelez marked this conversation as resolved.
Outdated
Comment thread
mazhelez marked this conversation as resolved.
Outdated
Comment thread
mazhelez marked this conversation as resolved.
Outdated
}
if (!(Test-Path -Path $sampleApp)) {
if (!$sampleApp -or !(Test-Path -Path $sampleApp)) {
throw "Could not locate sample app for the Business Central version"
}
Comment thread
mazhelez marked this conversation as resolved.

Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The `DownloadProjectDependencies` action now downloads only artifacts from depen
- Issue 2211 - Cannot create a release if a project contains only test apps
- Issue 2214 - Workspace compilation not working with external dependencies
- Issue 2235 - Workspace compilation: only the first `customCodeCops` entry resolved when multiple relative paths were configured. Relative `customCodeCops` paths are now resolved against the project folder before being passed to the compiler.
- Issue 2265 - Creating a Performance Test App fails on Linux due to case-sensitive path lookup for the Performance Toolkit sample app

## v9.0

Expand Down
39 changes: 39 additions & 0 deletions Tests/CreateApp.Action.Test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,43 @@

# Call action

It 'Should find Performance Toolkit sample app regardless of directory casing' {
# Simulate artifact folder structure with varying casing (as seen in BC28+)
$tempDir = Join-Path ([System.IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString())
try {
$sampleAppDir = Join-Path $tempDir "Applications" "TestFramework" "performancetoolkit"

Check notice

Code scanning / PSScriptAnalyzer

Cmdlet 'Join-Path' has positional parameter. Please use named parameters instead of positional parameters when calling a command. Note

Cmdlet 'Join-Path' has positional parameter. Please use named parameters instead of positional parameters when calling a command.
New-Item -Path $sampleAppDir -ItemType Directory -Force | Out-Null
$sampleAppFile = Join-Path $sampleAppDir "Microsoft_Performance Toolkit Samples.app"
Set-Content -Path $sampleAppFile -Value "dummy"

# Use the same lookup logic as in CreateApp.ps1
$result = Get-ChildItem -Path $tempDir -Filter "Microsoft_Performance Toolkit Samples.app" -Recurse | Select-Object -First 1 -ExpandProperty FullName

$result | Should -Not -BeNullOrEmpty
$result | Should -Be $sampleAppFile
}
finally {
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue
}
}

It 'Should find Performance Toolkit sample app with legacy lowercase casing' {
# Simulate artifact folder structure with old casing (pre-BC28)
$tempDir = Join-Path ([System.IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString())
try {
$sampleAppDir = Join-Path $tempDir "applications" "testframework" "performancetoolkit"
New-Item -Path $sampleAppDir -ItemType Directory -Force | Out-Null
$sampleAppFile = Join-Path $sampleAppDir "Microsoft_Performance Toolkit Samples.app"
Set-Content -Path $sampleAppFile -Value "dummy"

# Use the same lookup logic as in CreateApp.ps1
$result = Get-ChildItem -Path $tempDir -Filter "Microsoft_Performance Toolkit Samples.app" -Recurse | Select-Object -First 1 -ExpandProperty FullName

$result | Should -Not -BeNullOrEmpty
$result | Should -Be $sampleAppFile
}
finally {
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue
}
}
Comment thread
mazhelez marked this conversation as resolved.
Outdated
}
Loading