HodorNV / ALOps

ALOps
59 stars 24 forks source link

ALOpsAppTest is calling FinSql #309

Closed lvanvugt closed 3 years ago

lvanvugt commented 3 years ago

The ALOpsAppTest step is trying to prepare finsql while my pipeline is used latest (BC) build (see step ALOpsDockerCreate). I do not get why this happens and how to fix it.

the used yaml

name: $(Build.BuildId)

trigger:
 branches:
   include:
     - master/TestFixtureInitializer

variables:
- group: 'PipelineVariables'

pool: TestAutomationExamples

jobs:
- job: default
  timeoutInMinutes: 600
  pool: TestAutomationExamples

  steps:
  - checkout: self
    clean: true 

  - task: ALOpsDockerCreate@1
    displayName: 'ALOPS - Create Docker Image' # It will reuse the image if already exists, or build one if it doesn't.
    inputs:
      artifacttype: 'Sandbox'
      forcecreateimage: $(forceCreateImage)
      licensefile: '$(LuxBeheerBcDevLicense)'

  - task: ALOpsDockerStart@1
    displayName: 'ALOPS - Start Docker Container' # No need to provide any details - it will get the details from previous step

  - task: ALOpsDockerWait@1
    displayName: 'ALOPS - Wait for Docker Container to start'
    inputs:
      search_string: 'Ready for connections!'

  - task: ALOpsAppPublish@1
    displayName: 'ALOPS - Install AL TestTool' # install necessary dependent apps for testability
    inputs:
      usedocker: true
      installaltesttool: true
      skip_verification: true
      install_al_app_names: |
        Any
        Tests-Bank
        Tests-Cash Flow
        Tests-Cost Accounting
        Tests-CRM integration
        Tests-Data Exchange
        Tests-Dimension
        Tests-ERM
        Tests-Fixed Asset
        Tests-General Journal
        Tests-Graph
        Tests-Integration
        Tests-Invoicing
        Tests-Job
        Tests-Local
        Tests-Marketing
        Tests-Misc
        Tests-Monitor Sensitive Fields
        Tests-Permissions
        Tests-Physical Inventory
        Tests-Prepayment
        Tests-Rapid Start
        Tests-Report
        Tests-Resource
        Tests-Reverse
        Tests-SCM
        Tests-SINGLESERVER
        Tests-SMB
        Tests-SMTP
        Tests-TestLibraries
        Tests-Upgrade
        Tests-User
        Tests-VAT
        Tests-Workflow
        Test Runner
        Library Assert
        Library Variable Storage
        System Application Test
        System Application Test Library

  - task: ALOpsAppCompiler@1
    displayName: 'ALOPS - Compile Extension: App'
    inputs:
      usedocker: true
      nav_app_version: '1.0.[yyyyWW].*'
      targetproject: 'TestFixtureInitializer/app/app.json'
      app_file_suffix: '_APP'

  - task: ALOpsAppPublish@1
    displayName: 'ALOPS - Publish Extension'
    inputs:
      usedocker: true
      nav_artifact_app_filter: '*.app'
      skip_verification: true

  - task: ALOpsAppTest@1
    displayName: 'ALOPS - Run TestSuite'
    inputs:
      usedocker: true
      testfilter: '81000..'
      failed_test_action: 'Ignore'
    continueOnError: true
    timeoutInMinutes: 360

  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TestResults.xml'
    inputs:
      testResultsFormat: XUnit
      testResultsFiles: '**/TestResults.xml'
      failTaskOnFailedTests: true
      testRunTitle: 'BC Test Results: $(Build.BuildId)'

  - task: ALOpsDockerRemove@1
    displayName: 'ALOPS - Remove Docker Container'
    enabled: true
    condition: always()
    inputs:
      createsqlbackup: 'onfailure'

the output

##[section]Starting: ALOPS - Run TestSuite
--
==============================================================================
Task           : ALOps App Test
Description    : Run AL-TestSuite for Business Central
Version        : 1.438.2098
Author         : Hodor
Help           : Run Business Central Test-Suite and collect results.
==============================================================================
*** Validate configuration
*** Task Inputs:
 
name                           value
----                           -----
usedocker                       True
fixed_tag
nav_serverinstance             BC140
tenant                       default
companyname
profile
bc_username
bc_password
bc_authentication    NavUserPassword
bc_webclient_url
testfilter                   81000..
show_available_tests            True
import_testtoolkit              True
import_action              Overwrite
testpage                      130409
testsuite                    DEFAULT
installaltesttool              False
failed_test_action            Ignore
override_finsql_path
 
*** No ALOps License found. Set License with   the [alops-licenseid] or [alops_licenseid] variables.
*** To acquire a license, please visit:   https://www.alops.be/getlicense
*** For pricing options, please visit :   https://www.alops.be/pricing
*** For documentation, please visit   : https://www.alops.be/documentation
 
*** ALOps License:
* Trial Key  :   9e49a0a1-45c6-4038-b670-7f21fd35e892
* Licensed To: Public Project (Free License)
 
*** Importing required PS-Functions
*** Working folder:   C:\vsts-agent-win-x64-2.177.1\_work\6\s
***
*** Prepare Docker Session
*** Connect Docker Session
*** Initiate Docker Session
*** Set Docker Container   ErrorActionPreference = Stop
*** Copy Modules to Docker
*** Setup Docker Session
*** Checking for container-specific Test   Assemblies
*** Using container-specific Test Assemblies
*** Import Modules in Docker Session
*** Import UI Client   [C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll]
VERBOSE: Loading module from path   'C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll'.
*** Import NewtonSoft JSON [C:\Program   Files\Microsoft Dynamics NAV\170\Service\Newtonsoft.Json.dll]
*** Import Modules in Docker Session:   class_ClientContext
*** Test Context Url:   https://532a99291854/BC/cs?tenant=default
*** Setup BC Credentials in Docker
*** Resolve Docker Credentials
*** Prepare FinSql
*** Searching for Client-FinSql in Registry
*** Client-FinSql not found in registry:   [HKLM:\SOFTWARE\Wow6432Node\Microsoft\Microsoft Dynamics*\*\RoleTailored   Client]
*** Searching for Service-FinSql in Registry
*** Service-FinSql not found in registry:   [HKLM:\SOFTWARE\Wow6432Node\Microsoft\Microsoft Dynamics*\*\Service]
*** Searching for RoleTailoredClient-FinSql   in FileSystem
*** RoleTailoredClient-FinSql not found in   FileSystem: [C:\Program Files*\Microsoft Dynamics*\*\RoleTailored   Client\finsql.exe]
*** Searching for Service-FinSql in   FileSystem
*** Service-FinSql not found in FileSystem:   [C:\Program Files*\Microsoft Dynamics*\*\*\finsql.exe]
##[error]FinSql could not be located on   host.
##[section]Finishing: ALOPS - Run TestSuite

expected behavior No finsql related things (as were build on BC latest)

lvanvugt commented 3 years ago

Found the issue. Needed to add:

      import_action: "Skip"
      import_testtoolkit: false

Shouldn't this be the defaults moving toward an AL world only?

waldo1001 commented 3 years ago

Moving forward: yes. But .. there is no moving forward. There is: supporting different versions of artifact structure, BaseApp default apps, ways to call test apps, ... . It's horrific when you see all those different changes (in not only major releases, by the way .. also CU updates :().

No documentation whatsoever. So we need to act on this kind of wonderful feedback you guys send us ;-).