Skip to content
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

[Enhancement]: Run AppSource App Tests as part of CI/CD #1389

Closed
AlexanderMarcher opened this issue Jan 13, 2025 · 5 comments
Closed

[Enhancement]: Run AppSource App Tests as part of CI/CD #1389

AlexanderMarcher opened this issue Jan 13, 2025 · 5 comments
Labels
enhancement New feature or request

Comments

@AlexanderMarcher
Copy link

Feature description

I am interested in running tests on our AppSource application within the context of our Customer Apps as part of the CI/CD process.
Specifically, I would like to verify whether the code in our Customer Apps impacts the functionality of our AppSource app.

I noticed on the Roadmap that there are plans to include Microsoft Tests as part of the CI/CD pipeline. This functionality seems similar to what I’m looking to achieve.

Best regards,
Alexander

@AlexanderMarcher AlexanderMarcher added the enhancement New feature or request label Jan 13, 2025
@freddydk
Copy link
Contributor

Do I understand you correctly, you have some appsource apps and some PTEs and you want to run the tests from your appsource apps repo in the CI/CD of the PTE (which have a dependency on the appsource apps)?

@AlexanderMarcher
Copy link
Author

Yes that is correct

@freddydk
Copy link
Contributor

Currently, I think the best way to solve this is to use the setting "installTestApps" in your PTE repo and specify a URL, where the workflow can download your test apps from the appsource apps - potentially use deliver to storage and then use the latest of the testapps url.

Then it should run.

You can also create a dependency on the AppSource Test apps from your test apps in the PTE - then it I think it will find them and run them (if you are using GitHub Packages or appDependencyResolutionPath)

@AlexanderMarcher
Copy link
Author

Thank you for the quick replies I will look into this

@AlexanderMarcher
Copy link
Author

Hi again @freddydk

I have had success with using "installTestApps" to retrieve my test app, but when I try to run the tests I run into the error "The named pipe target process has ended.".

Running tests

Extracting C:\Users\runner\AppData\Local\Temp\a6241e76-ac24-483e-b090-a933611130e1\TRIMIT Development AS_TRIMIT Data and Test_24.2.10.10040_W1.app
  Running tests for App 2fc5ddd0-5274-4e7c-af36-cf7ce9a15c8b
  Using Container
  Connecting to http://localhost:80/BC/cs?tenant=default
  Setting test codeunit range ''
  The background process reported an error with the following message: "The named pipe target process has ended.".
  Exception Script Stack Trace:
  at Invoke-ScriptInBcContainer, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\ContainerHandling\Invoke-ScriptInNavContainer.ps1: line 61
  at Run-TestsInBcContainer, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-TestsInNavContainer.ps1: line 431
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1205
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2749
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2682
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2626
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1259
  at Run-AlPipeline, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1244
  at <ScriptBlock>, C:\actions-runner\_work\_actions\microsoft\AL-Go-Actions\v6.2\RunPipeline\RunPipeline.ps1: line 395
  at <ScriptBlock>, C:\actions-runner\_work\_temp\4dd1274a-b92c-4b0c-a4ed-681fbfe2716f.ps1: line 3
  at <ScriptBlock>, C:\actions-runner\_work\_actions\microsoft\AL-Go-Actions\v6.2\Invoke-AlGoAction.ps1: line 17
  at <ScriptBlock>, C:\actions-runner\_work\_temp\4dd1274a-b92c-4b0c-a4ed-681fbfe2716f.ps1: line 2
  at <ScriptBlock>, <No file>: line 1
  PowerShell Call Stack:
  at Invoke-ScriptInBcContainer, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\ContainerHandling\Invoke-ScriptInNavContainer.ps1: line 71
  at Run-TestsInBcContainer, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-TestsInNavContainer.ps1: line 431
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1205
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2749
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2682
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2626
  at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1259
  at Run-AlPipeline, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1244
  at <ScriptBlock>, C:\actions-runner\_work\_actions\microsoft\AL-Go-Actions\v6.2\RunPipeline\RunPipeline.ps1: line 395
  at <ScriptBlock>, C:\actions-runner\_work\_temp\4dd1274a-b92c-4b0c-a4ed-681fbfe2716f.ps1: line 3
  at <ScriptBlock>, C:\actions-runner\_work\_actions\microsoft\AL-Go-Actions\v6.2\Invoke-AlGoAction.ps1: line 17
  at <ScriptBlock>, C:\actions-runner\_work\_temp\4dd1274a-b92c-4b0c-a4ed-681fbfe2716f.ps1: line 2
  at <ScriptBlock>, <No file>: line 1
  Run-TestsInBcContainer Telemetry Correlation Id: b0269d8c-6[839](https://github.com/TRIMIT-Group/ARM-ALGO/actions/runs/12763715599/job/35574468602#step:9:854)-4527-b294-a5367f4381fd
Files in build artifacts folder:
  Dependencies\TRIMIT Development AS_TRIMIT_24.2.12.10095_W1.app (21479321 bytes)
Removing container
  Get Event Log from container
  Getting event log for bc12763715599
  Removing Session bc12763715599
  Removing container bc12763715599
  Removing entries from hosts
  Removing bc12763715599 from container hosts file
  Removing bc12763715599-* from container hosts file
  Removing Desktop shortcuts
  Removing C:\ProgramData\BcContainerHelper\Extensions\bc12763715599
  
Run-AlPipeline Telemetry Correlation Id: 092b8186-4064-4156-a274-0a32d831557e
Applying settings from C:\actions-runner\_work\ARM-ALGO\ARM-ALGO\.github\AL-Go-Settings.json
Applying settings from C:\actions-runner\_work\ARM-ALGO\ARM-ALGO\.AL-Go\settings.json
No settings found in C:\actions-runner\_work\ARM-ALGO\ARM-ALGO\.github\CICD.settings.json
No settings found in C:\actions-runner\_work\ARM-ALGO\ARM-ALGO\.AL-Go\CICD.settings.json
No settings found in C:\actions-runner\_work\ARM-ALGO\ARM-ALGO\.AL-Go\AlexanderMarcher.settings.json
Enabling Microsoft telemetry...
Error: Unexpected error when running action. Error Message: The background process reported an error with the following message: "The named pipe target process has ended."., StackTrace: at Run-TestsInBcContainer, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-TestsInNavContainer.ps1: line 571 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1205 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2749 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2682 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2626 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1259 <- at Run-AlPipeline, C:\ProgramData\BcContainerHelper\6.0.30\BcContainerHelper\AppHandling\Run-
Error: Process completed with exit code 1.

Container creation

PS CallStack  :
  - Write-PSCallStack (HelperFunctions.ps1 Line 1639)
  - <ScriptBlock> (Run-AlPipeline.ps1 Line 567)
  - GetBuildContainer (Run-AlPipeline.ps1 Line 554)
  - <ScriptBlock> (Run-AlPipeline.ps1 Line 1412)
  - <ScriptBlock> (Run-AlPipeline.ps1 Line 1367)
  - <ScriptBlock> (Run-AlPipeline.ps1 Line 1259)
  - Run-AlPipeline (Run-AlPipeline.ps1 Line 1244)
  - <ScriptBlock> (RunPipeline.ps1 Line 395)
  - <ScriptBlock> (4dd1274a-b92c-4b0c-a4ed-681fbfe2716f.ps1 Line 3)
  - <ScriptBlock> (Invoke-AlGoAction.ps1 Line 17)
  - <ScriptBlock> (4dd1274a-b92c-4b0c-a4ed-681fbfe2716f.ps1 Line 2)
  - <ScriptBlock> ( Line 1)
  Creaing docker container
  BcContainerHelper is version 6.0.30
  BcContainerHelper is running as administrator
  HyperV is Enabled
  Host is Microsoft Windows Server 2022 Standard - 10.0.20348.2966
  UsePsSession is True
  UsePwshForBc24 is True
  UseWinRmSession is allow
  UseSslForWinRmSession is True
  Docker Client Version is 24.0.1
  Docker Server Version is 24.0.1
  Removing Desktop shortcuts
  Fetching all docker images
  Fetching all docker volumes
  ArtifactUrl and ImageName specified
  Image my:sandbox-25.2.27733.28869-w1-mt already exists
  Using image my:sandbox-25.2.27733.28869-w1-mt
  Creating Container bc12763715599
  Style: sandbox
  Multitenant: Yes
  Version: 25.2.27733.28869
  Platform: 25.2.[287](https://github.com/TRIMIT-Group/ARM-ALGO/actions/runs/12763715599/job/35574468602#step:9:294)71.0
  Generic Tag: 1.0.2.53
  Container OS Version: 10.0.20348.2966 (ltsc2022)
  Host OS Version: 10.0.20348.2966 (ltsc2022)
  Host and container OS match, recommended isolation mode is process.
  Using process isolation
  Using locale en-US
  Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
  Additional Parameters:
  --volume "C:\actions-runner\_work\ARM-ALGO\ARM-ALGO\:c:\sources"
  --expose 5986
  --env customNavSettings=EnableTaskScheduler=False
  Files in C:\ProgramData\BcContainerHelper\Extensions\bc12763715599\my:
  - AdditionalOutput.ps1
  - AdditionalSetup.ps1
  - HelperFunctions.ps1
  - MainLoop.ps1
  - SetupVariables.ps1
  - updatehosts.ps1
  Creating container bc12763715599 from image my:sandbox-25.2.27733.[288](https://github.com/TRIMIT-Group/ARM-ALGO/actions/runs/12763715599/job/35574468602#step:9:295)69-w1-mt
  00080832a0be254dabf862755903f28f5aa6f7818e72b01146e07cd8140428c5
  Waiting for container bc12763715599 to be ready
  Initializing...
  Setting host.containerhelper.internal to 172.29.112.1 in container hosts file
  Starting Container
  Hostname is bc12763715599
  PublicDnsName is bc12763715599
  Using NavUserPassword Authentication
  Starting Local SQL Server
  Starting Internet Information Server
  Creating Self Signed Certificate
  Self Signed Certificate Thumbprint 254A4B419362C4E52001043312EBD64E22B998D9
  DNS identity bc12763715599
  Modifying Service Tier Config File with Instance Specific Settings
  Modifying Service Tier Config File with settings from environment variable
  Setting EnableTaskScheduler to False
  Starting Service Tier
  Registering event sources
  Creating DotNetCore Web Server Instance
  Using application pool name: BC
  Using default container name: NavWebApplicationContainer
  Copy files to WWW root C:\inetpub\wwwroot\BC
  Create the application pool BC
  Create website: NavWebApplicationContainer without SSL
  Update configuration: navsettings.json
  Done Configuring Web Client
  Enabling Financials User Experience
  Dismounting Tenant
  Mounting Tenant
  Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
  Sync'ing Tenant
  Tenant is Operational
  Creating http download site
  Setting SA Password and enabling SA
  Creating admin as SQL User and add to sysadmin
  Creating SUPER user
  Enable PSRemoting and setup user for winrm
  Creating self-signed certificate for winrm
  Container IP Address: 172.29.124.24
  Container Hostname  : bc12763715599
  Container Dns Name  : bc12763715599
  Web Client          : http://bc12763715599/BC/?tenant=default
  Dev. Server         : http://bc12763715599
  Dev. ServerInstance : BC
  Dev. Server Tenant  : default
  Setting bc12763715599 to 172.29.124.24 in host hosts file
  Setting bc12763715599-default to 172.29.124.24 in host hosts file
  Setting bc12763715599-default to 172.29.124.24 in container hosts file
  
  Files:
  http://bc12763715599:8080/ALLanguage.vsix
  
  Container Total Physical Memory is 32.0Gb
  Container Free Physical Memory is 23.7Gb
  
  Initialization took 125 seconds
  Ready for connections!
  Reading CustomSettings.config from bc12763715599
  Creating Desktop Shortcuts for bc12763715599
  Cleanup old dotnet core assemblies
  Container bc12763715599 successfully created
  
  Use:
  Get-BcContainerEventLog -containerName bc12763715599 to retrieve a snapshot of the event log from the container
  Get-BcContainerDebugInfo -containerName bc12763715599 to get debug information about the container
  Enter-BcContainer -containerName bc12763715599 to open a PowerShell prompt inside the container
  Remove-BcContainer -containerName bc12763715599 to remove the container again
  docker logs bc12763715599 to retrieve information about URL's again
  
  Creating Container took 142 seconds
  Copy C:\ProgramData\BcContainerHelper\Extensions\bc12763715599\d2191acf-eae7-46ab-a0f4-687f2eeaf211\TRIMIT Development AS_TRIMIT_24.2.12.10095_W1.app to C:\actions-runner\_work\ARM-ALGO\ARM-ALGO\.buildartifacts\Dependencies
  Publishing C:\ProgramData\BcContainerHelper\Extensions\bc1276[371](https://github.com/TRIMIT-Group/ARM-ALGO/actions/runs/12763715599/job/35574468602#step:9:378)5599\d2191acf-eae7-46ab-a0f4-687f2eeaf211\TRIMIT Development AS_TRIMIT_24.2.12.10095_W1.app
  Synchronizing TRIMIT on tenant default
  Installing TRIMIT on tenant default
  App TRIMIT Development AS_TRIMIT_24.2.12.10095_W1.app successfully published
  
  Installing apps took 616 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants