Open ricardopaiva opened 2 years ago
Hi, some ideas:
It sounds like you're all setup OK, just trying to get some more info.
Thanks. In the meanwhile i just noticed that i forgot to key in the TestSuiteName in the config.json file but after i did it i get the same behavior. I will do some more testing, based on your inputs/questions and i will let you know.
It seems like I was able to make it work by doing a change on the Test-Runner-Service app. On the Service.codeunit.al file:
trigger OnAfterTestRun(CodeunitId: Integer; CodeunitName: Text; FunctionName: Text; Permissions: TestPermissions; Success: Boolean) begin if (FunctionName = '') then exit; if not Success then begin Error(GetLastErrorText() + '\ \' + GetLastErrorCallStack()); end; end;
If seems like the FunctionName parameter when the OnAfterTestRun is being called for the first time is empty and the Success parameter is false, so an error is being retrieved all the time. I couldn't understand why this is happening. I thought it was because of the OnRun trigger on the test codeunit but after removing it the behavior was still the same.
Does this make sense to you?
Hey, I'm facing a similar problem with that piece of code. I'm trying to debug a test and the debugger won't hit any breakpoint in my test. It does stop on breakpoints in "Test Runner Service JP" though. After the failing test hits "OnAfterTestRun" th error is not being collected, since FunctionName is empty and TestName is the current tests name:
`trigger OnAfterTestRun(CodeunitId: Integer; CodeunitName: Text; FunctionName: Text; Permissions: TestPermissions; Success: Boolean) begin if not Success then if (TestCodeunitId = CodeunitId) and (FunctionName = TestName) then Error(GetLastErrorText() + GetLastErrorCallStack());
if not Success then
FailedTests += 1;
end;`
Also I get "Exception of type 'Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLDialogException' was thrown." in the Terminal which I can not get further details on. Not in the event log, nor via application insights.
Any idea what is keeping me from attaching the debugger to the test of choice?
Best regards
Sven
Is it a timing issue, because the next session actually is the test runner, which uses new sessions for each test, so those are not in scope?
Do you see any difference if you attach the debugger yourself before debugging the test? (as opposed to the extension attaching the debugger)
Hi, I'm trying to setup and use the AL Test Runner but I'm unable to get any output from the test execution. What I'm using:
What I've done:
What I get: When I try to run a test from the Test Explorer, I get the following on the Terminal:
I've tried to manually run the Invoke-TestRunnerService.ps1 script and debug it and here's where it stops:
You can see that there's no message in the error so I get no output on the Terminal:
I was not able to understand why the Invoke-WebRequest is failing.
I have debug the AL Test Runner Service and the TestRunner codeunit (codeunit 79151 "Test Runner JP") is being called but I guess that some error is being retrieved, I just cannot find it. On the OnAfterTestRun trigger, the Success parameter is False but GetLastErrorText() and GetLastErrorCallStack() returns no error.
I couldn't find any related error in the container Event Viewer log.
Any hint?