microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
385 stars 247 forks source link

Run-AlPipeline does not install Microsoft Test Extentions #2347

Closed cssteam-franzpikal closed 2 years ago

cssteam-franzpikal commented 2 years ago

I am trying to build a CI/CD pipeline in DevOps based on the Run-AlPipeline script (from your awesome workshop pdf). The pipeline does not load the Microsoft Test extensions (e.g.: Microsoft_Tests-Bank.app etc.) into the created container. When I check the container with Get-NavContainerAppInfo after the pipeline is done, it does only contains the Library Assert, Library Variable Storage, etc. extensions. If I understood the documentation (https://freddysblog.com/2020/10/08/run-alpipeline/) correctly, this should load the runner, the test framework extensions, and the extensions containing the tests but not the perf test extensions.

Creating a container with New-BCContainer and passing the -includeTestToolkit switch works like a charm. The extensions are loaded and I can then call Run-TestsInBCContainer with the extensions AppId and all the contained tests are executed. Perhaps you can point me in the right direction.

2022-03-11T07:49:26.1244188Z ========================== Starting Command Output =========================== 2022-03-11T07:49:26.1456423Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\agent_work_temp\d1d36b38-c11b-42a9-9865-56f3f4f7fe74.ps1'" 2022-03-11T07:49:26.6116759Z Set artifact = //18.0.23013.36253/us 2022-03-11T07:49:26.6133443Z Set pipelineName = fmpMyApp-ci 2022-03-11T07:49:26.6199787Z Set containerName = fmptestagent-fmpmyapp-ci 2022-03-11T07:49:26.6490796Z Set installApps = '' 2022-03-11T07:49:26.6502973Z Set installTestApps = 'True' 2022-03-11T07:49:26.6535893Z Set previousApps = '' 2022-03-11T07:49:26.6546298Z Set appSourceCopMandatoryAffixes = '' 2022-03-11T07:49:26.6558254Z Set appSourceCopSupportedCountries = '' 2022-03-11T07:49:26.6593091Z Set appFolders = 'app,base' 2022-03-11T07:49:26.6617498Z Set testFolders = 'test' 2022-03-11T07:49:26.6679021Z Set memoryLimit = '10G' 2022-03-11T07:49:26.6697448Z Set additionalCountries = '' 2022-03-11T07:49:26.6705858Z Set genericImageName = '' 2022-03-11T07:49:26.6740214Z Set vaultNameForLocal = 'cd-cicd-pipeline' 2022-03-11T07:49:26.6766830Z Set bcContainerHelperVersion = 'preview' 2022-03-11T07:49:26.6811006Z Set installTestRunner = True 2022-03-11T07:49:26.6851316Z Set installTestFramework = False 2022-03-11T07:49:26.6878803Z Set installTestLibraries = True 2022-03-11T07:49:26.6907114Z Set installPerformanceToolkit = False 2022-03-11T07:49:26.6932873Z Set enableCodeCop = False 2022-03-11T07:49:26.6961956Z Set enableAppSourceCop = False 2022-03-11T07:49:26.6988543Z Set enablePerTenantExtensionCop = True 2022-03-11T07:49:26.7019988Z Set enableUICop = True 2022-03-11T07:49:26.7048260Z Set doNotSignApps = True 2022-03-11T07:49:26.7058990Z Set doNotRunTests = False 2022-03-11T07:49:26.7086979Z Set cacheImage = True 2022-03-11T07:49:26.7113776Z Set CreateRuntimePackages = True 2022-03-11T07:49:27.4985727Z BcContainerHelper version 3.0.3-preview556 2022-03-11T07:49:27.5050254Z BcContainerHelper emits usage statistics telemetry to Microsoft 2022-03-11T07:49:29.3639842Z Determining artifacts to use

Here is the full output of the DevOps-pipeline run is in the attachment. pipelineLogRaw_20220311T0754.txt

freddydk commented 2 years ago

you can specify additional test dependencies in the parameter -InstallTestApps

-InstallTestApps @(":C:\Applications\BaseApp\Test\Microsoft_....app")

There is also a -installApps for app dependencies. the : in front of the path indicates for containerhelper that the file is inside the container.

cssteam-franzpikal commented 2 years ago

Thanks for the tip. I will try it out immediately. Do I have to take care of the correct sequence in this list or does the script handle the dependencies?

freddydk commented 2 years ago

If you specify a .zip file with 5 apps, these will be unpacked and sorted by dependencies. If you specify 5 .app files in an array - they will be installed in the order you provide. If you specify 5 .zip files with 5 apps in each, every .zip file will be handled in the order provided and unpacked+sorted one by one.

Hope that makes sense.

cssteam-franzpikal commented 2 years ago

I got it working by adding the test-app extentions in a single zip file. Thx for the tip and for the great work and support!