Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Actions/AL-Go-Helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
59 changes: 59 additions & 0 deletions Tests/ResolveProjectFolders.Test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,65 @@
$projectSettings.bcptTestFolders | Should -Contain $(Join-Path '.' 'bcptApp2')
}

It 'Detects test apps and infers test toolkit installation from <libraryName> 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
Expand Down
Loading