Question
· Mar 24, 2022

Errors when using TestCoverage, ':ERROR #5002: ObjectScript error:'

Hello everyone!

When running the command 

do ##class(TestCoverage.Manager).RunTest(,"/nodelete",.userParams)

I now get the following error.

ERROR #5002 : ObjectScript error:  <FUNCTION>zStart+45^%Monitor.System.LineByLine.1  <<==== **FAILED** TestCoverage.Manager:OnBeforeAllTests:::

These tests run fine in Studio. 

Also the TestCoverage works fine on all the other namespaces. So far i'm experienceing this problem on this 1 namespace.

The solution of stopping the LinebyLine monitor doesn't help like in the case of ERROR #6060

Can someone please point me in the right direction?

Product version: IRIS 2021.1
Discussion (9)4
Log in or sign up to continue

I'm calling
TEST-EHR>DO ##class(TestCoverage.Manager).RunTest(,"/nodelete",.tCoverageParams)

my tCoverageParams are the following.  

TEST-EHR>zw tCoverageParams
tCoverageParams("CoverageClasses")=$lb("modul.ehr.host.check.CheckOperation","modul.ehr.host.docadd.EHRAddOrUpdateOperation")
tCoverageParams("CoverageDetail")=3
tCoverageParams("SourceNamespace")="TEST-EHR"
tCoverageParams("Timing")=0

On further review, you get a <FUNCTION> error from trying to start the line-by-line monitor when no routines are selected, and the work around is to change namespace to %SYS, do ^PERFMON, and stop the monitor.

USER>zw ##class(%Monitor.System.LineByLine).Start("","",$job)
"0 "_$lb($lb(5002,"<FUNCTION>zStart+45^%Monitor.System.LineByLine.1",,,,,,,,$lb(,"USER",$lb("$^zStart+45^%Monitor.System.LineByLine.1 +1","X^@ +1"))))/* ERROR #5002: ObjectScript error: <FUNCTION>zStart+45^%Monitor.System.LineByLine.1 */

In terms of using the test coverage tool, you should either put a file named coverage.list in your unit test root or pass the list of classes/routines in userParam as described at https://github.com/intersystems/TestCoverage .

https://github.com/intersystems/TestCoverage/issues/11 covers the bad behavior you've seen and would prevent it going forward. (Subsequent attempts to start the line-by-line monitor will end up hitting error #6060 as described in https://github.com/intersystems/TestCoverage/issues/10 .)