Closed DanielGoehler closed 1 week ago
Hm. Would you be able to test with a companyname in the parameter?
I added the companyname "CRONUS DE" but the result is the same:
##[section]Starting: Run TestSuite
==============================================================================
Task : ALOps App Test
Description : Run AL-TestSuite for Business Central
Version : 1.463.5245
Author : Hodor
Help : Run Business Central Test-Suite and collect results.
==============================================================================
*** Validate configuration
*** Task Inputs:
name value
---- -----
usedocker True
fixed_tag
nav_serverinstance
tenant default
companyname CRONUS DE
profile
bc_username
bc_password
bc_authentication NavUserPassword
bc_webclient_url
testfilter
disabledtests
show_available_tests True
import_testtoolkit False
import_action Overwrite
testpage 130455
testsuite DEFAULT
extensionid
installaltesttool False
failed_test_action Error
override_finsql_path
resultfilename TestResults.xml
testrunnercodeunitid
True
*** For documentation, please visit : https://www.alops.be/documentation
*** ALOps License:
* Licensed To: prisma informatik GmbH (Organisation License)
*** Importing required PS-Functions
*** Working folder: C:\agent\_work\1495\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]
*** Selected module: [C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll]
*** Loading module: [C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll]
*** Import NewtonSoft JSON [C:\Program Files\Microsoft Dynamics NAV\240\Service\Management\Newtonsoft.Json.dll]
*** Import Modules in Docker Session: class_ClientContext
*** Test Context Url: https://f27fee7e4361/BC/cs?tenant=default&company=CRONUS%20DE
*** Setup BC Credentials in Docker
*** Resolve Docker Credentials
*** Set TCP Keep-Alive
*** Start TestSuite
*** Running TestSuite with authentication [NavUserPassword] with User [admin]
*** Run warm-up with page [130455]
*** Warm-up Client Context
ERROR DIALOG: You must choose a company before you can access the "Global Application User Settings" table.
*** Create Client Context
*** Get Available Tests for suite [DEFAULT] with page [130455]
Show dialog 00000000-0000-0000-0800-0000836bd2d2
Title: Dialog Error
ERROR DIALOG: You must choose a company before you can access the "Global Application User Settings" table.
##[error]Run-Test-Exception: Cannot open page 130455. You might need to import the test toolkit to the container and/or remove the folder and retry. You might also have URL or Company name wrong.
*** Get XUnit Test file from [] to [C:\agent\_work\1495\s\]
##[error]Das Argument kann nicht an den Parameter "Path" gebunden werden, da es NULL ist.
##[section]Finishing: Run TestSuite
@DanielGoehler is this still a problem with the new build?
@waldo1001 Yes, but now only for a few repos. They all have the same pipelines with the same Test libraries. All are PTE projects and use the same dev licences. I don't see what the difference is.
@waldo1001 is it possible to disable the heat-up or add the company name to the heat-up call? I suspect this step as the problem.
Disabling the warm-up won't help, because it will fail in one of the next steps.
Can you export the eventlog?
cfr: https://docs.alops.be/ALOpsSteps/Buildstepsv1/#alops_docker_remove
@waldo1001 Sure, attached you find the eventlog: 9c88fb310b_20240425_133422.zip
2024-04-25T11:34:08.7639182Z ##[section]Starting: Run TestSuite
2024-04-25T11:34:08.7671851Z ==============================================================================
2024-04-25T11:34:08.7672048Z Task : ALOps App Test
2024-04-25T11:34:08.7672164Z Description : Run AL-TestSuite for Business Central
2024-04-25T11:34:08.7672285Z Version : 1.464.6041
2024-04-25T11:34:08.7672372Z Author : Hodor
2024-04-25T11:34:08.7672472Z Help : Run Business Central Test-Suite and collect results.
2024-04-25T11:34:08.7672600Z ==============================================================================
2024-04-25T11:34:09.7743295Z *** Validate configuration
2024-04-25T11:34:09.9997185Z *** Task Inputs:
2024-04-25T11:34:10.0002040Z
2024-04-25T11:34:10.0101383Z name value
2024-04-25T11:34:10.0101968Z ---- -----
2024-04-25T11:34:10.0102901Z usedocker True
2024-04-25T11:34:10.0103760Z fixed_tag
2024-04-25T11:34:10.0104395Z nav_serverinstance
2024-04-25T11:34:10.0105280Z tenant default
2024-04-25T11:34:10.0105959Z companyname CRONUS DE
2024-04-25T11:34:10.0106787Z profile
2024-04-25T11:34:10.0107508Z bc_username
2024-04-25T11:34:10.0108320Z bc_password
2024-04-25T11:34:10.0109131Z bc_authentication NavUserPassword
2024-04-25T11:34:10.0109822Z bc_webclient_url
2024-04-25T11:34:10.0110761Z testfilter
2024-04-25T11:34:10.0111479Z disabledtests
2024-04-25T11:34:10.0112316Z show_available_tests True
2024-04-25T11:34:10.0113050Z import_testtoolkit False
2024-04-25T11:34:10.0113889Z import_action Overwrite
2024-04-25T11:34:10.0114987Z testpage 130455
2024-04-25T11:34:10.0115826Z testsuite DEFAULT
2024-04-25T11:34:10.0117758Z extensionid
2024-04-25T11:34:10.0118160Z installaltesttool False
2024-04-25T11:34:10.0118427Z failed_test_action Error
2024-04-25T11:34:10.0119192Z override_finsql_path
2024-04-25T11:34:10.0120119Z resultfilename TestResults.xml
2024-04-25T11:34:10.0120965Z testrunnercodeunitid
2024-04-25T11:34:10.0121166Z
2024-04-25T11:34:10.0144463Z
2024-04-25T11:34:10.0153487Z
2024-04-25T11:34:10.0306918Z True
2024-04-25T11:34:10.0494865Z *** For documentation, please visit : https://www.alops.be/documentation
2024-04-25T11:34:10.0498443Z
2024-04-25T11:34:10.2745044Z *** ALOps License:
2024-04-25T11:34:10.2766135Z * Licensed To: prisma informatik GmbH (Organisation License)
2024-04-25T11:34:10.2770641Z
2024-04-25T11:34:10.2909281Z *** Importing required PS-Functions
2024-04-25T11:34:10.3384157Z *** Working folder: C:\agent\_work\1795\s
2024-04-25T11:34:10.3391012Z ***
2024-04-25T11:34:10.3397781Z *** Prepare Docker Session
2024-04-25T11:34:10.4325172Z *** Connect Docker Session
2024-04-25T11:34:10.4405384Z *** Initiate Docker Session
2024-04-25T11:34:10.7713224Z *** Set Docker Container ErrorActionPreference = Stop
2024-04-25T11:34:11.1685704Z *** Copy Modules to Docker
2024-04-25T11:34:13.6297825Z *** Setup Docker Session
2024-04-25T11:34:13.6656307Z *** Checking for container-specific Test Assemblies
2024-04-25T11:34:13.6686095Z *** Using container-specific Test Assemblies
2024-04-25T11:34:13.7716392Z *** Import Modules in Docker Session
2024-04-25T11:34:13.9842836Z *** Import UI Client [C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll]
2024-04-25T11:34:14.0038053Z *** Selected module: [C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll]
2024-04-25T11:34:14.0041026Z *** Loading module: [C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll]
2024-04-25T11:34:14.1809675Z *** Import NewtonSoft JSON [C:\Program Files\Microsoft Dynamics NAV\240\Service\Management\Newtonsoft.Json.dll]
2024-04-25T11:34:14.2018951Z *** Import Modules in Docker Session: class_ClientContext
2024-04-25T11:34:14.5401561Z *** Test Context Url: https://9c88fb310b8f/BC/cs?tenant=default&company=CRONUS%20DE
2024-04-25T11:34:14.5408255Z *** Setup BC Credentials in Docker
2024-04-25T11:34:14.6815686Z *** Resolve Docker Credentials
2024-04-25T11:34:14.7259664Z *** Set TCP Keep-Alive
2024-04-25T11:34:14.7499945Z *** Start TestSuite
2024-04-25T11:34:14.7845042Z *** Running TestSuite with authentication [NavUserPassword] with User [admin]
2024-04-25T11:34:14.7868440Z *** Run warm-up with page [130455]
2024-04-25T11:34:14.7891305Z *** Warm-up Client Context
2024-04-25T11:34:18.3643105Z ERROR DIALOG: You must choose a company before you can access the "Global Application User Settings" table.
2024-04-25T11:34:18.8501625Z *** Create Client Context
2024-04-25T11:34:20.3282080Z *** Get Available Tests for suite [DEFAULT] with page [130455]
2024-04-25T11:34:20.5387075Z Show dialog 00000000-0000-0000-0800-0000836bd2d2
2024-04-25T11:34:20.5941680Z Title: Dialog Error
2024-04-25T11:34:20.5956249Z ERROR DIALOG: You must choose a company before you can access the "Global Application User Settings" table.
2024-04-25T11:34:20.8737298Z ##[error]Run-Test-Exception: Cannot open page 130455. You might need to import the test toolkit to the container and/or remove the folder and retry. You might also have URL or Company name wrong.
2024-04-25T11:34:20.9833298Z *** Get XUnit Test file from [] to [C:\agent\_work\1795\s\]
2024-04-25T11:34:21.1634249Z ##[error]Das Argument kann nicht an den Parameter "Path" gebunden werden, da es NULL ist.
2024-04-25T11:34:21.2055237Z ##[section]Finishing: Run TestSuite
Hm. The eventlog doesn't show anything useful.
Would you be able to send us a repro? A repo & yaml that fails on your end?
@DanielGoehler ?
@waldo1001 I haven't been able to create an example that I can share publicly. It is possible to share this privately as a here?
Sure!
@waldo1001 I have sent this email.
Is there any progress to get this resolved in the near future?
This problem occurs in more projects for BC24 versions now. Currenlty the only option is to disable the CI for tests in BC24 projects, but this isn't a real option.
@waldo1001 By accident, a colleague found the issue. In BC24, there's likely an upgrade/install step that runs without a client context. We've changed the logic (setting Global Application User Settings to DataPerCompany = false), and now it works fine.
@waldo1001 By accident, a colleague found the issue. In BC24, there's likely an upgrade/install step that runs without a client context. We've changed the logic (setting Global Application User Settings to DataPerCompany = false), and now it works fine.
Thanks a lot. Till today, we were still not able to repro it. I'm not sure what you mean with "global application user settings"? 🤔
@waldo1001 Global Application User Settings is a custom table, but I wasn't aware of this until I saw the Pull Request.
Hm, that makes sense... does it happen to be doing something OnCompanyOpen or something?
@pri-kise Can you answer this?
@pri-kise Can you answer this?
Wait - @pri-kise and you are the same company?
The Global Application User Settings
is a custom table (not in the related app, but a dependency).
There was a a subscriber for the table "Application User Setting" (System Table).
This table has "DataPerCompany=false". This has never been any problem when the code was triggered via UI since there is always a company context.
But BC24 added an upgrade (UpgradePerDatabase) where no Company Context is set.
And yes I'm in the same company.
Hm, ok. Thanks for explaining. Now I also understand why the ticket was closed when you (Killian) still had an outstanding question ;-).
Thanks for the info!
Sorry for the confusion. Next time, I'll include this information.
@waldo1001 if we could get the StackTrace (from the event log) of the error then we could have solved that much faster.
@waldo1001 if we could get the StackTrace (from the event log) of the error then we could have solved that much faster.
You can, can't you? https://github.com/HodorNV/ALOps/blob/master/Examples/19_ExportEventLog.yml
Yes, we did, but the event log wasn't useful. You wrote:
Hm. The eventlog doesn't show anything useful.
Would you be able to send us a repro? A repo & yaml that fails on your end?
Ah, ok - you mean there's no stacktrace in the eventlog .. :-/. I didn't know - sometimes there is a stacktrace, like when you log slow running SQL.. .
Well, may be we should have set up Telemetry from the image, and look into Telemetry.
May be a tip: https://youtu.be/PLRkN2UBhTg?t=4070 In that session, I address the extra possibility to add Telemetry-events on the test-framework. We do that. in that way, you could go to the stacktrace from there .. ?
Describe the bug When testing against BC NextMinor or BC NextMajor with
ALOpsAppTest
you get an dialog error message:the used yaml
NextMinor.yml
templates/CompileAndTest.yml
the output Also the complete output is necessary for us to see what is going on. Also use backtics: