diff --git a/Actions/AL-Go-Helper.ps1 b/Actions/AL-Go-Helper.ps1 index a109f29bb..48afa78a6 100644 --- a/Actions/AL-Go-Helper.ps1 +++ b/Actions/AL-Go-Helper.ps1 @@ -204,11 +204,12 @@ $anyAppId = "e7320ebb-08b3-4406-b1ec-b4927d3e280b" $libraryAssertAppId = "dd0be2ea-f733-4d65-bb34-a28f4624fb14" $libraryVariableStorageAppId = "5095f467-0a01-4b99-99d1-9ff1237d286f" $systemApplicationTestLibraryAppId = "9856ae4f-d1a7-46ef-89bb-6ef056398228" +$applicationTestLibraryAppId = "d852d5d2-a39d-4179-baeb-f99a19e32510" $TestsTestLibrariesAppId = "5d86850b-0d76-4eca-bd7b-951ad998e997" $performanceToolkitAppId = "75f1590f-55c5-4501-ae63-bada5534e852" $performanceToolkitApps = @($performanceToolkitAppId) -$testLibrariesApps = @($systemApplicationTestLibraryAppId, $TestsTestLibrariesAppId) +$testLibrariesApps = @($systemApplicationTestLibraryAppId, $applicationTestLibraryAppId, $TestsTestLibrariesAppId) $testFrameworkApps = @($anyAppId, $libraryAssertAppId, $libraryVariableStorageAppId) + $testLibrariesApps $testRunnerApps = @($permissionsMockAppId, $testRunnerAppId) + $performanceToolkitApps + $testLibrariesApps + $testFrameworkApps diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 65efbb7a1..ddc00d2a2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,5 +1,7 @@ ### Issues +- Issue 2480 - Recognize test apps whose only Microsoft test dependency is Application Test Library and automatically enable test runner, framework, and library installation. + - Issue 2405 - Fix AppSource publishing failures reporting duplicate extension IDs when multiple versions of the same dependency are included. Only the highest included version is submitted. ## v10.1 diff --git a/Tests/ResolveProjectFolders.Test.ps1 b/Tests/ResolveProjectFolders.Test.ps1 index 301090ad8..8858323e1 100644 --- a/Tests/ResolveProjectFolders.Test.ps1 +++ b/Tests/ResolveProjectFolders.Test.ps1 @@ -187,6 +187,65 @@ $projectSettings.bcptTestFolders | Should -Contain $(Join-Path '.' 'bcptApp2') } + It 'Detects test apps and infers test toolkit installation from alone' -TestCases @( + @{ libraryName = 'Application Test Library'; libraryId = 'd852d5d2-a39d-4179-baeb-f99a19e32510' } + @{ libraryName = 'System Application Test Library'; libraryId = '9856ae4f-d1a7-46ef-89bb-6ef056398228' } + @{ libraryName = 'Tests-TestLibraries'; libraryId = '5d86850b-0d76-4eca-bd7b-951ad998e997' } + ) { + param($libraryName, $libraryId) + + $projectFolder = Join-Path $TestDrive $libraryId + $appFolder = Join-Path $projectFolder 'My App' + $testFolder = Join-Path $projectFolder 'My App Tests' + New-Item -Path $appFolder, $testFolder -ItemType Directory | Out-Null + $appId = [Guid]::NewGuid().ToString() + @{ + id = $appId + name = 'My App' + dependencies = @() + } | ConvertTo-Json -Depth 99 | Set-Content -Path (Join-Path $appFolder 'app.json') -Encoding UTF8 + @{ + id = [Guid]::NewGuid().ToString() + name = 'My App Tests' + dependencies = @( + @{ id = $appId; name = 'My App'; version = '28.0.0.0' } + @{ id = $libraryId; name = $libraryName; version = '28.0.0.0' } + ) + } | ConvertTo-Json -Depth 99 | Set-Content -Path (Join-Path $testFolder 'app.json') -Encoding UTF8 + + $projectSettings = @{ appFolders = @(); testFolders = @(); bcptTestFolders = @() } + ResolveProjectFolders -baseFolder $projectFolder -project '.' -projectSettings ([ref] $projectSettings) + + $projectSettings.appFolders | Should -HaveCount 1 + $projectSettings.appFolders | Should -Contain (Join-Path '.' 'My App') + $projectSettings.testFolders | Should -HaveCount 1 + $projectSettings.testFolders | Should -Contain (Join-Path '.' 'My App Tests') + $projectSettings.bcptTestFolders | Should -HaveCount 0 + + $settings = @{ + type = 'PTE' + applicationDependency = '28.0.0.0' + appFolders = @() + testFolders = @() + bcptTestFolders = @() + appDependencies = @() + testDependencies = @() + projectsToTest = @() + installTestRunner = $false + installTestFramework = $false + installTestLibraries = $false + doNotRunBcptTests = $false + doNotBuildTests = $false + doNotRunTests = $false + } + $settings = AnalyzeRepo -settings $settings -baseFolder $projectFolder -doNotCheckArtifactSetting + + $settings.installTestRunner | Should -BeTrue + $settings.installTestFramework | Should -BeTrue + $settings.installTestLibraries | Should -BeTrue + $settings.doNotRunTests | Should -BeFalse + } + AfterAll { Pop-Location Remove-Item -Path $baseFolder -Recurse -Force