HodorNV / ALOps

ALOps
59 stars 24 forks source link

ALOpsAppPublish Install AL TestTool: install_al_app_names ignored? #193

Closed DanielGoehler closed 4 years ago

DanielGoehler commented 4 years ago

Describe the bug _install_al_appnames seems to be ignored by ALOpsAppPublish while AL Test Tool installation.

the used yaml

- task: ALOpsAppPublish@1
  displayName: 'ALOps - Install AL TestTool'
  inputs:
    usedocker: true
    installaltesttool: true
    skip_verification: true
    install_al_app_names: 'Test Runner'

the output

##[section]Starting: ALOps - Install AL TestTool
==============================================================================
Task         : ALOps App Publish
Description  : Publish AL Extension to Business Central
Version      : 1.434.1680
Author       : Hodor
Help         : Publish Business Central extension to service tier.
==============================================================================
*** Validate configuration

*** Importing required PS-Functions
 - Use Docker         = True
 - Artifact Path      = 
 - App Filter         = *.app
 - Process Type       = Build
 - Skip Verification  = True
 - Force Sync         = False

*** Importing required PS-Functions
*** Initiate Docker Session
*** Set Docker Container ErrorActionPreference = Stop
*** Install AL TestTool: True
*** Start AL-TestTool installation
*** Import NAV/BC Management DLL's
*** Loading assemblies for ServiceTier [BC].
*** Loading assemblies from: [C:\program files\microsoft dynamics nav\160\service]
*** Selected module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Apps.Management.dll]
*** Loading module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Apps.Management.dll]
*** Selected module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Management.dll]
*** Loading module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Management.dll]
*** Check MockAssemblies.
*** Application requested for installation:
  * Any
  * Library Assert
  * System Application Test
  * System Application Test Library
  * Test Runner
  * Tests-TestLibraries

*** Get Available Applications from [C:\Applications*\].
*** Get [*.app] files recursive from [C:\Applications*\]
*** Found [88] files.
*** Extract App detail from [C:\Applications\AMCBanking365Fundamentals\Source\Microsoft_AMC Banking 365 Fundamentals.app]
*** Extract App detail from [C:\Applications\AMCBanking365Fundamentals\Test\Microsoft_AMC Banking 365 Fundamentals Tests.app]
*** Extract App detail from [C:\Applications\APIV1\Source\Microsoft__Exclude_APIV1_.app]
*** Extract App detail from [C:\Applications\APIV1\Test\Microsoft__Exclude_APIV1_ Tests.app]
*** Extract App detail from [C:\Applications\Application\Source\Microsoft_Application.app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Base Application.app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Czech language (Czechia).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Danish language (Denmark).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Dutch language (Belgium).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Dutch language (Netherlands).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_English language (Australia).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_English language (Canada).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_English language (New Zealand).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_English language (United Kingdom).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_English language (United States).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Finnish language (Finland).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_French language (Belgium).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_French language (Canada).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_French language (France).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_French language (Switzerland).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_German language (Austria).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_German language (Germany).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_German language (Switzerland).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Icelandic language (Iceland).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Italian language (Italy).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Italian language (Switzerland).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Norwegian language (Norway).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Russian language (Russia).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Spanish language (Mexico).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Spanish language (Spain).app]
*** Extract App detail from [C:\Applications\BaseApp\Source\Microsoft_Swedish language (Sweden).app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Library-NoTransactions.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Bank.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Cash Flow.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Cost Accounting.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-CRM integration.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Data Exchange.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Dimension.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-ERM.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Fixed Asset.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-General Journal.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Graph.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Integration.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Invoicing.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Job.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Local.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Marketing.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Misc.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Permissions.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Physical Inventory.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Prepayment.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Rapid Start.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Report.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Resource.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Reverse.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-SCM.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-SINGLESERVER.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-SMB.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-SMTP.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-TestLibraries.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Upgrade.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-User.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-VAT.app]
*** Extract App detail from [C:\Applications\BaseApp\Test\Microsoft_Tests-Workflow.app]
*** Extract App detail from [C:\Applications\ClientAddIns\Source\Microsoft__Exclude_ClientAddIns_.app]
*** Extract App detail from [C:\Applications\Elster\Source\Microsoft_ELSTER VAT Localization for Germany.app]
*** Extract App detail from [C:\Applications\Elster\Test\Microsoft_ELSTER VAT Localization for Germany Tests.app]
*** Extract App detail from [C:\Applications\EssentialBusinessHeadlines\Source\Microsoft_Essential Business Headlines.app]
*** Extract App detail from [C:\Applications\EssentialBusinessHeadlines\Test\Microsoft_Essential Business Headlines Test.app]
*** Extract App detail from [C:\Applications\HybridBaseDeployment\Source\Microsoft_Intelligent Cloud Base.app]
*** Extract App detail from [C:\Applications\HybridBaseDeployment\Test\Microsoft_Intelligent Cloud Base Tests.app]
*** Extract App detail from [C:\Applications\HybridBC\Source\Microsoft_Business Central Intelligent Cloud.app]
*** Extract App detail from [C:\Applications\HybridBC\Test\Microsoft_Business Central Intelligent Cloud Tests.app]
*** Extract App detail from [C:\Applications\LatePaymentPredictor\Source\Microsoft_Late Payment Prediction.app]
*** Extract App detail from [C:\Applications\LatePaymentPredictor\Test\Microsoft_Late Payment Prediction Tests.app]
*** Extract App detail from [C:\Applications\PayPalPaymentsStandard\Source\Microsoft_PayPal Payments Standard.app]
*** Extract App detail from [C:\Applications\PayPalPaymentsStandard\Test\Microsoft_PayPal Payments Standard Tests.app]
*** Extract App detail from [C:\Applications\SalesAndInventoryForecast\Source\Microsoft_Sales and Inventory Forecast.app]
*** Extract App detail from [C:\Applications\SalesAndInventoryForecast\Test\Microsoft_Sales and Inventory Forecast Tests.app]
*** Extract App detail from [C:\Applications\SendToEmailPrinter\Source\Microsoft_Send To Email Printer.app]
*** Extract App detail from [C:\Applications\system application\source\Microsoft_System Application.app]
*** Extract App detail from [C:\Applications\system application\test\Microsoft_System Application Test Library.app]
*** Extract App detail from [C:\Applications\system application\test\Microsoft_System Application Test.app]
*** Extract App detail from [C:\Applications\TestFramework\TestLibraries\Any\Microsoft_Any.app]
*** Extract App detail from [C:\Applications\TestFramework\TestLibraries\Assert\Microsoft_Library Assert.app]
*** Extract App detail from [C:\Applications\TestFramework\TestRunner\Microsoft_Test Runner.app]
*** Extract App detail from [C:\Applications\WorldPayPaymentsStandard\Source\Microsoft_WorldPay Payments Standard.app]
*** Extract App detail from [C:\Applications\WorldPayPaymentsStandard\Test\Microsoft_WorldPay Payments Standard Tests.app]
*** Substitute W1 extensions with localised versions if available
*** Available Applications:
*** Installing Applications:
*** Get App Info: C:\Applications\system application\test\Microsoft_System Application Test Library.app
*** Publish App: [Microsoft / System Application Test Library]
*** Sync App: [Microsoft / System Application Test Library]
*** Install App: [Microsoft / System Application Test Library]
***
*** Get App Info: C:\Applications\BaseApp\Test\Microsoft_Tests-TestLibraries.app
*** Publish App: [Microsoft / Tests-TestLibraries]
*** Sync App: [Microsoft / Tests-TestLibraries]
*** Install App: [Microsoft / Tests-TestLibraries]
***
*** Get App Info: C:\Applications\TestFramework\TestLibraries\Assert\Microsoft_Library Assert.app
*** Publish App: [Microsoft / Library Assert]
*** Sync App: [Microsoft / Library Assert]
*** Install App: [Microsoft / Library Assert]
***
*** Get App Info: C:\Applications\TestFramework\TestLibraries\Any\Microsoft_Any.app
*** Publish App: [Microsoft / Any]
*** Sync App: [Microsoft / Any]
*** Install App: [Microsoft / Any]
***
*** Get App Info: C:\Applications\TestFramework\TestRunner\Microsoft_Test Runner.app
*** Publish App: [Microsoft / Test Runner]
*** Sync App: [Microsoft / Test Runner]
*** Install App: [Microsoft / Test Runner]
***
*** Get App Info: C:\Applications\system application\test\Microsoft_System Application Test.app
*** Publish App: [Microsoft / System Application Test]
*** Sync App: [Microsoft / System Application Test]
*** Install App: [Microsoft / System Application Test]
***

*** AL-TestTool installation completed.
*** AL-TestTool installation finished.

 Id Name            ComputerName    ComputerType    State         ConfigurationName     Availability
 -- ----            ------------    ------------    -----         -----------------     ------------
  1 WinRM1          28c48a24c5d9... Container       Opened                                 Available
*** Disconnect Docker session.
*** Remove Docker session.
*** Docker session removed.
*** AL-Extension Published to ALOps Repository
*** Cleanup VSTS Environment: True
##[section]Finishing: ALOps - Install AL TestTool

Expected behavior In this case only install Test Runner

waldo1001 commented 4 years ago

Hm, I never did this, but try to set installaltesttool to false.. and install by appname..

- task: ALOpsAppPublish@1
  displayName: 'ALOps - Install AL TestTool'
  inputs:
    usedocker: true
    installaltesttool: false
    skip_verification: true
    install_al_app_names: 'Test Runner'
DanielGoehler commented 4 years ago

installaltesttool = false doesn't work. The dependency app will be published, but not Test Runner. See output below. What influences this from the output above?

*** Application requested for installation:
  * Any
  * Library Assert
  * System Application Test
  * System Application Test Library
  * Test Runner
  * Tests-TestLibraries

Output

##[section]Starting: ALOps - Install AL TestTool
==============================================================================
Task         : ALOps App Publish
Description  : Publish AL Extension to Business Central
Version      : 1.434.1680
Author       : Hodor
Help         : Publish Business Central extension to service tier.
==============================================================================
*** Importing required PS-Functions
 - Use Docker         = True
 - Artifact Path      = 
 - App Filter         = *.app
 - Process Type       = Build
 - Skip Verification  = True
 - Force Sync         = False

*** Importing required PS-Functions
*** Initiate Docker Session
*** Set Docker Container ErrorActionPreference = Stop
*** Install AL TestTool: False
*** Working folder: C:\agent\_work\26\s
*** Artifact folder: C:\agent\_work\26\a
*** Pipeline workspace: C:\agent\_work\26
***
*** Copy Artifacts to Docker Container: 9b9260028e78f45f49c9cd52edc1ec1a21eb19e9c55c13e3986d659fe845aaa4
*** Docker Artifacts Folder: c:\Run\DevOps\Artifacts
*** Dynamic resolve App file.
*** Scanning [System.DefaultWorkingDirectory].
*** Scanning [System.ArtifactsDirectory].
*** Scanning [Pipeline.Workspace].
*** Multiple App files found with filter [*.app].
  * C:\agent\_work\26\s\MainApp\.dependencies\Some Company_Comsol Atlas_16.4.4.0.app
  * C:\agent\_work\26\s\MainApp\.dependencies\Some Company_Some Solution_16.1.9.3.app
*** Resolved App File: [Some Company_Some Solution_16.1.9.3.app].
*** Copy Artifact: [C:\agent\_work\26\s\MainApp\.dependencies\Some Company_Some Solution_16.1.9.3.app]
*** Import NAV/BC Management DLL's
*** Loading assemblies for ServiceTier [BC].
*** Loading assemblies from: [C:\program files\microsoft dynamics nav\160\service]
*** Selected module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Apps.Management.dll]
*** Loading module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Apps.Management.dll]
*** Selected module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Management.dll]
*** Loading module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Management.dll]

**************************************
 * App File = [c:\Run\DevOps\Artifacts\Some Company_Some Solution_16.1.9.3.app]

 * App.ID        = b44bad3e-e88d-4b5d-9813-8d1a96b9e34b
 * App.Name      = Some Solution
 * App.Publisher = Some Company
 * App.Version   = 16.1.9.3
 => Publishing App 'Some Solution v16.1.9.3'
*** Get Tenants

PSComputerName                         : 9b9260028e78f45f49c9cd52edc1ec1a21eb19e9c55c13e3986d659fe845aaa4
RunspaceId                             : 9a2773b9-b9f1-496c-bae6-6aeb37e5c311
ServerInstance                         : MicrosoftDynamicsNavServer$BC
DatabaseName                           : CRONUS
DatabaseServer                         : localhost\SQLEXPRESS
DatabaseUserName                       : 
State                                  : Operational
DetailedState                          : 
DeletionState                          : Not deleted
IsInExclusiveAccessMode                : False
TenantDataVersion                      : 16.4.15445.0
Compression                            : Unspecified
Id                                     : default
AlternateId                            : {}
AllowAppDatabaseWrite                  : True
NasServicesEnabled                     : False
RunNasWithAdminRights                  : False
EncryptionProvider                     : LocalKeyFile
AzureKeyVaultSettings                  : 
DefaultCompany                         : 
DefaultTimeZone                        : UTC
ExchangeAuthenticationMetadataLocation : https://outlook.office365.com/
AadTenantId                            : common
ApplicationInsightsKey                 : 
DisplayName                            : 
EnvironmentName                        : 
EnvironmentType                        : Production

ServerInstance                        : MicrosoftDynamicsNavServer$BC
ExtensionDataVersion                  : 
IsInstalled                           : False
SyncState                             : NotSynced
NeedsUpgrade                          : False
IsPublished                           : True
PSComputerName                        : 9b9260028e78f45f49c9cd52edc1ec1a21eb19e9c55c13e3986d659fe845aaa4
RunspaceId                            : 9a2773b9-b9f1-496c-bae6-6aeb37e5c311
Brief                                 : Some Solution
Description                           : Sanctionlist Screening for Business Central
CompatibilityId                       : 0.0.0.0
PrivacyStatement                      : https://www.contoso.com/datenschutz
Eula                                  : https://static.contoso.com/somesolution/comsol_software_license_term.html
Help                                  : https://static.contoso.com/somesolution/docu
Url                                   : https://www.contoso.com/somesolution
Logo                                  : /logo/somesolution_113x113.png
DeveloperTenantId                     : 
ScreenShots                           : {}
Dependencies                          : {Application, Microsoft, 16.0.0.0, False}
Capabilities                          : {}
PackageId                             : 986a1641-d064-47e9-bffa-6cf68a495970
PublisherAzureActiveDirectoryTenantId : 
AppId                                 : b44bad3e-e88d-4b5d-9813-8d1a96b9e34b
Name                                  : Some Solution
Publisher                             : Some Company
Version                               : 16.1.9.3
ExtensionType                         : ModernDev
Scope                                 : Global
Tenant                                : 

*** Sync Tenant default
*** Sync App [Some Solution] on tenant [default]
*** Install App [Some Solution] on tenant [default]

**************************************

ComputerType           : Container
ComputerName           : 9b9260028e78f45f49c9cd52edc1ec1a21eb19e9c55c13e3986d659fe845aaa4
ContainerId            : 9b9260028e78f45f49c9cd52edc1ec1a21eb19e9c55c13e3986d659fe845aaa4
VMName                 : 
VMId                   : 
ConfigurationName      : 
InstanceId             : 9a2773b9-b9f1-496c-bae6-6aeb37e5c311
Id                     : 1
Name                   : WinRM1
Availability           : Available
ApplicationPrivateData : {DebugMode, DebugStop, UnhandledBreakpointMode, PSVersionTable...}
Runspace               : System.Management.Automation.RemoteRunspace
State                  : Opened
IdleTimeout            : -1
OutputBufferingMode    : 
DisconnectedOn         : 
ExpiresOn              : 

*** Disconnect Docker session.
*** Remove Docker session.
*** Docker session removed.
*** AL-Extension Published to ALOps Repository
*** Cleanup VSTS Environment: True
##[section]Async Command Start: Add Build Tag
Build '1725' has following tags now: App.Some Solution.16.1.9.3, BC.Platform.16.0.14648.15420, BC.Version.16.4.14693.15445, myimage-onprem-16.4.14693.15445-de-10.0.17763.1457-ltsc2019
##[section]Async Command End: Add Build Tag
##[section]Finishing: ALOps - Install AL TestTool
waldo1001 commented 4 years ago

can I ask what the intention is of all this? What are you trying to achieve?

DanielGoehler commented 4 years ago

Sure. I have only a few tests, which has no dependencies to the Microsoft Test Libraries and I like to save some time, because I only need the AL Test Suite.

Build Process

waldo1001 commented 4 years ago

It's ALOps that add these automatically, just to help people that might forget to add these necessary apps. I'm afraid there is no way around this (else we would break other tests if we would remove it).

If you want to gain time - you can create your own Docker image now with the tests included. That will save you a lot of time.. .

DanielGoehler commented 4 years ago

Yeah, that's right.

We already have, even at the beginning, many different BC versions and two build agent VMs, and plan to increase this number due to the increased build pipeline runs. At the moment we have not yet learned about centralized container management.

So I'm taking a simple way out and adding the Test Runner app to the git Repo as a dependency.