Skip to content

Fix Missing Test Apps after Import-TestToolkitToBcContainer #3841

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion CompilerFolderHandling/New-BcCompilerFolder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ try {
Write-Host "App apps"
$appApps | ForEach-Object { Write-Host "- $($_.Name)" }
}
'Microsoft_Tests-*.app','Microsoft_Performance Toolkit Samples*.app','Microsoft_Performance Toolkit Tests*.app','Microsoft_System Application Test Library*.app','Microsoft_TestRunner-Internal*.app','Microsoft_Business Foundation Test Libraries*.app','Microsoft_AI Test Toolkit*.app' | ForEach-Object {
'Microsoft_Tests-*.app', 'Microsoft_Performance Toolkit Samples*.app', 'Microsoft_Performance Toolkit Tests*.app', 'Microsoft_System Application Test Library*.app', 'Microsoft_TestRunner-Internal*.app', 'Microsoft_Business Foundation Test Libraries*.app', 'Microsoft_AI Test Toolkit*.app', 'Microsoft_* Tests.app', 'Microsoft_* Test Library.app' | ForEach-Object {
$appName = $_
$apps = $appApps | Where-Object { $_.Name -like $appName }
if (!$apps) {
Expand Down
18 changes: 15 additions & 3 deletions HelperFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,10 @@ function GetTestToolkitApps {

if (!$includeTestFrameworkOnly) {
# Add Test Libraries
$apps += "Microsoft_System Application Test Library.app", "Microsoft_Business Foundation Test Libraries.app", "Microsoft_Tests-TestLibraries.app", 'Microsoft_AI Test Toolkit.app' | ForEach-Object {
$apps += "Microsoft_System Application Test Library.app", "Microsoft_Business Foundation Test Libraries.app", "Microsoft_Tests-TestLibraries.app", 'Microsoft_AI Test Toolkit.app', 'Microsoft_Library Outlook REST API.app', 'Microsoft_Prevent Metadata Updates.app' | ForEach-Object {
@(get-childitem -Path "C:\Applications\*.*" -recurse -filter $_)
}
$apps += gci "C:\Applications\*\Test Library" | gci -filter "*.app"

if (!$includeTestLibrariesOnly) {
# Add Tests
Expand All @@ -457,9 +458,19 @@ function GetTestToolkitApps {
@(get-childitem -Path "C:\Applications\*.*" -recurse -filter $_)
}
}
$apps += @(get-childitem -Path "C:\Applications\*.*" -recurse -filter "Microsoft_Tests-*.app") | Where-Object { $_ -notlike "*\Microsoft_Tests-TestLibraries.app" -and ($version.Major -ge 17 -or ($_ -notlike "*\Microsoft_Tests-Marketing.app")) -and $_ -notlike "*\Microsoft_Tests-SINGLESERVER.app" }
$apps += @(get-childitem -Path "C:\Applications\*.*" -recurse) | ? { $_.name -like "Microsoft_Tests-*.app" -or $_.FullName -match '\\Test\\.*[ _]Test(?:s?| Automations).app' } | Where-Object { ($version.Major -ge 17 -or ($_ -notlike "*\Microsoft_Tests-Marketing.app")) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It almost looks like it's easier just to explicitly list what to include and/or exclude.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was not sure about this while implementing. i decide for this solution so we are not forced to change this when msft adds a new app. on the other side, it is not possible to see at a quick glance which apps are published

as pr description says this would have been simpler / nicer if msft had a consistent folder structure and naming pattern :/

we currently have around 82 test apps and 12 libraries
if you prefer to list all apps just say a word.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as pr description says this would have been simpler / nicer if msft had a consistent folder structure and naming pattern :/

That we definitely agree on. But this is also not something we can change overnight.

Both explicitly listing the apps to include/exclude and matching the name with a patter have advantages and disadvantages.
I am more leaning towards the former as:

  • it's easier to get an overview which apps are included/excluded
  • new apps are not being added by default, which might be a good thing as there'll be no side effects.

What do you think?

}
}
# Always exclude these apps
$apps = $apps `
| Where-Object { $_.name -notlike "Microsoft_E-Document Connector - Avalara Tests.app" } `
| Where-Object { $_.name -notlike "Microsoft_E-Document Connector - B2Brouter Tests.app" } `
| Where-Object { $_.name -notlike "Microsoft_E-Document Connector - Logiq Tests.app" } `
| Where-Object { $_.name -notlike "Microsoft_E-Document Connector - Pagero Tests.app" } `
| Where-Object { $_.name -notlike "Microsoft_E-Document Connector - SignUp Tests.app" } `
| Where-Object { $_.name -notlike "Microsoft_Service Declaration Tests.app" } `
| Where-Object { $_.name -notlike "*Field Service Integration*.app" } `
| Where-Object { $_.name -notlike "Microsoft_Tests-SINGLESERVER.app" }
}

if ($includePerformanceToolkit) {
Expand All @@ -469,13 +480,14 @@ function GetTestToolkitApps {
}
}

$apps | ForEach-Object {
$apps = $apps | ForEach-Object {
$appFile = Get-ChildItem -path "c:\applications.*\*.*" -recurse -filter ($_.Name).Replace(".app", "_*.app")
if (!($appFile)) {
$appFile = $_
}
$appFile.FullName
}
$apps | Select-Object -Unique
} -argumentList $includeTestLibrariesOnly, $includeTestFrameworkOnly, $includeTestRunnerOnly, $includePerformanceToolkit
}
}
Expand Down
1 change: 1 addition & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
6.1.7
Issue 3952 Get-AlLanguageExtensionFromArtifacts fails on new BC artifacts
Add support for TestType field when running tests
Issue 3729 Missing Test Apps after Import-TestToolkitToBcContainer

6.1.6
Added a new outcome to failOn = newWarning. For BcContainerHelper it will work as error - in AL-Go for GitHub it will have a meaning.
Expand Down