-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Thank you for submitting a Pull Request. If you're new to contributing to AlAppExtensions please read our pull request guideline below * https://github.com/microsoft/ALAppExtensions/blob/main/CONTRIBUTING.md --> #### Summary <!-- Provide a general summary of your changes --> Reenable tests by uninstalling apps that aren't supported in W1 before we start running tests. This will ensure tests don't accidently trigger e.g. event subscribers from apps that aren't supported in W1 anyway. Right now we are building, publishing and testing apps on top of a W1 Base App even though some of them aren't supported in W1. We'll continue to compile the apps. We just won't have them installed when running tests. With this change, tests are working again: https://github.com/microsoft/ALAppExtensions/actions/runs/11664233820 Another way we could solve this from AL-Go would could define anti patterns for app/test folders. In that case we would have the following in the AL-Go settings `testFolders: [ Apps/W1/*/app/, !Apps/W1/INTaxEngine/app ] ` #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes [AB#556300](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/556300)
- Loading branch information
1 parent
9a75182
commit e2a83ee
Showing
5 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
{ | ||
"MaxAllowedObsoleteVersion": "24" | ||
"MaxAllowedObsoleteVersion": "24", | ||
"AppsNotToBePublished": [ | ||
"AMC Banking 365 Fundamentals", | ||
"AMC Banking 365 Fundamentals Test Automations", | ||
"Automatic Account Codes", | ||
"Automatic Account Codes Tests", | ||
"Basic Experience", | ||
"Basic Experience Tests", | ||
"Dynamics GP History SmartLists", | ||
"Dynamics GP Historical Data", | ||
"Dynamics GP Historical Data Tests", | ||
"Dynamics GP Intelligent Cloud", | ||
"Dynamics GP Intelligent Cloud Tests", | ||
"Image Analyzer", | ||
"Image Analyzer Tests", | ||
"Import of QuickBooks Payroll Files", | ||
"Quickbooks Payroll File Import Tests", | ||
"Send remittance advice by email Tests", | ||
"AMC Banking 365 Fundamentals Test Automations", | ||
"Tax Engine", | ||
"Tax Engine Test", | ||
"Transactions and Receipts Storage", | ||
"WorldPay Payments Standard", | ||
"WorldPay Payments Standard Tests" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Param( | ||
[Parameter(ParameterSetName="ALGo")] | ||
[Hashtable]$parameters, | ||
[Parameter(ParameterSetName="Manual")] | ||
[string]$containerName | ||
) | ||
|
||
Import-Module "$PSScriptRoot\EnlistmentHelperFunctions.psm1" | ||
|
||
function Get-NavDefaultCompanyName | ||
{ | ||
return "CRONUS International Ltd." | ||
} | ||
|
||
if ($PSCmdlet.ParameterSetName -eq 'ALGo') { | ||
$containerName = $parameters.ContainerName | ||
} | ||
|
||
# Unpublish apps that should not be published | ||
$installedApps = Get-BcContainerAppInfo -containerName $parameters.ContainerName -tenantSpecificProperties -sort DependenciesLast | ||
$appsToBeUnPublished = (Get-ConfigValue -ConfigType "BuildConfig" -Key "AppsNotToBePublished") | ||
$installedApps | ForEach-Object { | ||
if ($_.Name -in $appsToBeUnPublished) { | ||
Write-Host "Unpublishing $($_.Name)" | ||
Unpublish-BcContainerApp -containerName $parameters.ContainerName -name $_.Name -unInstall -doNotSaveData -doNotSaveSchema -force | ||
} | ||
} | ||
|
||
# Import test data | ||
try { | ||
$repoVersion = Get-ConfigValue -ConfigType "AL-GO" -Key "RepoVersion" | ||
$DemoDataType = "EXTENDED" | ||
|
||
Write-Host "Initializing company" | ||
Invoke-NavContainerCodeunit -Codeunitid 2 -containerName $containerName -CompanyName (Get-NavDefaultCompanyName) | ||
|
||
Write-Host "Importing configuration package" | ||
Invoke-NavContainerCodeunit -Codeunitid 8620 -containerName $containerName -CompanyName (Get-NavDefaultCompanyName) -MethodName "ImportAndApplyRapidStartPackage" -Argument "C:\ConfigurationPackages\NAV$($repoVersion).W1.ENU.$($DemoDataType).rapidstart" | ||
} catch { | ||
Write-Host "Error while importing configuration package" | ||
Write-Host $_.Exception.Message | ||
Write-Host $_.Exception.StackTrace | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
Build/projects/1st Party Apps Tests (W1)/.AL-Go/ImportTestDataInBcContainer.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Param( | ||
[Hashtable]$parameters | ||
) | ||
|
||
$script = Join-Path $PSScriptRoot "../../../scripts/ImportTestDataInBcContainer.ps1" -Resolve | ||
. $script -parameters $parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters