intersystems / TestCoverage

Test Coverage Tool
MIT License
9 stars 8 forks source link

ExtrinsicFunctions - Code coverage when ExtrinsicFunctions are enabled #54

Closed stevelee12 closed 3 weeks ago

stevelee12 commented 2 months ago

Hi

I've been writting tests for Cache ObjectScript routines and all was working OK. Today, I had to enable ExtrinsicFunctions on the IRIS Container instance that runs the tests as our production code requires them. Since enabling this I get the following error:

TestCoverage-v3.1.0.xml:

Collecting coverage data for all tests: 2.68131 seconds
Mapping to class/routine coverage:
ERROR #5540: SQLCODE: -149 Message: SQL Function TESTCOVERAGE.BITWISE_OR failed with error:  SQLCODE=-400,%msg=ERROR #5002: ObjectScript error: <ZSQER>%0AmIm9l9tudf+1^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1
Use the following URL to view the result:

TestCoverage-v4.0.3.xml

Collecting coverage data for all tests: 3.384454 seconds
Mapping to class/routine coverage:
ERROR #5540: SQLCODE: -149 Message: SQL Function TESTCOVERAGE.BITWISE_OR failed with error:  SQLCODE=-400,%msg=ERROR #5002: ObjectScript error: <ZSQER>%0AmIm9l9tudf+1^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1
Use the following URL to view the result:

$ZV: IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2022.1.5 (Build 940U) Thu Apr 18 2024 14:30:11 EDT

The code coverage output is partial, it likely stops mid way through.

If I disable ExtrinsicFunctions and run the same code, the error doesnt happen (however I'm unable to unit test my code)

Is this a known issue?

isc-tleavitt commented 2 months ago

@stevelee12 it's the first we're hearing of this - thank you for reporting.

isc-tleavitt commented 2 months ago

Interestingly, I can't reproduce this on:

IRIS for Windows (x86-64) 2024.1 (Build 267.2U) Tue Apr 30 2024 16:41:33 EDT

Giving it a try on a 2022.1 instance I have handy; it seems possible/likely that this is an IRIS bug.

isc-tleavitt commented 2 months ago

I also haven't managed to reproduce the error on:

IRIS for Windows (x86-64) 2022.1.4 (Build 812U) Mon Oct 16 2023 10:09:39 EDT

Which should be close enough. Process:

zpm "install TestCoverage"
zpm "load https://github.com/intersystems/git-source-control"
Do $System.SQL.SetAllowExtrinsicFunctions(1)
Do $System.SQL.PurgeAllNamespaces()
Do $System.OBJ.CompilePackage("TestCoverage")
zpm "git-source-control test -only -DUnitTest.ManagerClass=TestCoverage.Manager -DUnitTest.Case=UnitTest.SourceControl.Git.NameTest -verbose"

In terms of debugging steps, it would be helpful if you could select to retain cached query source: image

And then send the cached query source, which might provide some indicator as to what is throwing the exception. More likely though it's just being generated at compile time.

isc-tleavitt commented 2 months ago

My cached query source has:

%0AmGm7l0tudf() try { new err RETURN ##class("TestCoverage.Procedures").BitValue(i%CoveredLines,i%FromLine) }
    catch err { set SQLCODE=-149,%msg="SQL Function TESTCOVERAGE.BIT_VALUE failed with error:  SQLCODE="_err.AsSQLCODE()_",%msg="_err.AsSQLMessage() ztrap "SQER" }
%0AmIm9l9tudf() try { new err RETURN ##class("TestCoverage.Procedures").ListToBit(i%%dlistNVAR16) }
    catch err { set SQLCODE=-149,%msg="SQL Function TESTCOVERAGE.LIST_TO_BIT failed with error:  SQLCODE="_err.AsSQLCODE()_",%msg="_err.AsSQLMessage() ztrap "SQER" }
%0AmIm9l9tudf0() try { new err RETURN ##class("TestCoverage.Procedures").BitwiseOr($$%0AmIm9l9tudf(),i%CoveredLinesO1) }
    catch err { set SQLCODE=-149,%msg="SQL Function TESTCOVERAGE.BITWISE_OR failed with error:  SQLCODE="_err.AsSQLCODE()_",%msg="_err.AsSQLMessage() ztrap "SQER" }

Indicating that somehow TestCoverage.Procedures:ListToBit is throwing an exception. The only way this could happen is if it was passed a $ListBuild list containing nulls or empty strings, which I don't think should happen from an SQL perspective, but maybe it is somehow.

Could you try replacing TestCoverage.Procedures:ListToBit with:

ClassMethod ListToBit(pSource As %List) As %Binary [ SqlName = LIST_TO_BIT, SqlProc ]
{
    Set tResult = ""
    Set tPointer = 0
    While $ListNext(pSource,tPointer,tBitPosition) {
        If $Data(tBitPosition)#2 && (tBitPosition '= "") {
            Set $Bit(tResult,tBitPosition) = 1
        }
    }
    Quit tResult
}

And see if that fixes the issue on your instance?

stevelee12 commented 2 months ago

Thanks as always Tim As requested, cached queries enabled, changed ListToBit. Error still occurs and here's the cached query:

image

Suggests its TestCover.Data.Run.cls, sql statement on line 60, which ironically, has quite a fun comment :)

If I run the query without the cursor I see:

image

If I remove the calculated field and just list out in the individual fields instead, the live ABOVE the highlighted line is line 44

image
isc-tleavitt commented 2 months ago

ok, here's something else you could try: zbreak *err:"N"::"try { do err.Log() } catch {}" Then run your unit tests and see what shows up in the Application Error Log.

isc-tleavitt commented 2 months ago

(alternatively, could wrap the ListToBit code in a try/catch and log the exception from there)

stevelee12 commented 2 months ago

OK Updated ListToBit to

/// Convert a $ListBuild list of integers into a $Bit with 1s in positions present in the list
/// Use in SQL with the %DLIST aggregate
ClassMethod ListToBit(pSource As %List) As %Binary [ SqlName = LIST_TO_BIT, SqlProc ]
{
    Set tResult = ""
    Set tPointer = 0
    try {
        While $ListNext(pSource,tPointer,tBitPosition) {
            Set $Bit(tResult,tBitPosition) = 1
        }
    } Catch e {
        Set tSC = e.AsStatus()
        S ^SLTemp($I(^SLTemp))=tSC
    }

    Quit tResult
}

and I'm seeing

^SLTemp(1)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^zExecuteTests+32^MyPkg.UnitTest.Manager.1^1","d^zExecuteTests+14^MyPkg.UnitTest.Manager.1^2","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(2)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^zExecuteTests+32^MyPkg.UnitTest.Manager.1^1","d^zExecuteTests+14^MyPkg.UnitTest.Manager.1^2","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(3)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^zExecuteTests+32^MyPkg.UnitTest.Manager.1^1","d^zExecuteTests+14^MyPkg.UnitTest.Manager.1^2","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(4)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^zExecuteTests+32^MyPkg.UnitTest.Manager.1^1","d^zExecuteTests+14^MyPkg.UnitTest.Manager.1^2","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(5)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^zExecuteTests+32^MyPkg.UnitTest.Manager.1^1","d^zExecuteTests+14^MyPkg.UnitTest.Manager.1^2","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(6)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^zExecuteTests+32^MyPkg.UnitTest.Manager.1^1","d^zExecuteTests+14^MyPkg.UnitTest.Manager.1^2","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(7)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^zExecuteTests+32^MyPkg.UnitTest.Manager.1^1","d^zExecuteTests+14^MyPkg.UnitTest.Manager.1^2","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */

MyPkg.UnitTest.Manager is a simple wrapper class that runs this command once (no loops):

; Files to monitor code coverage against
S tCoverageParams("CoverageClasses")=""
S tCoverageParams("CoverageRoutines")=tRoutines
S tCoverageParams("CoverageDetail")=0
S tSC=##class(TestCoverage.Manager).RunTest(,"/nodelete",.tCoverageParams)
I $$$ISERR(tSC) W "RunTest with code coverage failed." D $SYSTEM.Status.DisplayError(tSC) Q
;

where tRoutines is a string like ("routine1","routine2","routine3")

stevelee12 commented 2 months ago

For sanity I removed my wrapper class from the equation and ran the following from terminal:

S ^SLTemp=0
S ^UnitTestRoot="/tmp/tst/UnitTest"
S tSC=##class(My.TestHelper).GetRoutines(.tRoutines)
S tCoverageParams("CoverageClasses")=""
S tCoverageParams("CoverageRoutines")=tRoutines
S tCoverageParams("CoverageDetail")=0
S tSC=##class(TestCoverage.Manager).RunTest(,"/nodelete",.tCoverageParams)

Same SQL results, debug global reads:

^SLTemp(1)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(2)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(3)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(4)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(5)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(6)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
^SLTemp(7)="0 "_$lb($lb(5002,"<VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1",,,,,,,,$lb(,"MYNS",$lb("^zListToBit+5^TestCoverage.Procedures.1^1","e^%0AmIm9l9tudf^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIm9l9tudf0^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^3","e^%0AmIk2+5^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zFET+3^%sqlcq.MYNS.xEgcWXTGyQAeZs1SQwetG1ClxqO1.1^1","d^zMapRunCoverage+59^TestCoverage.Data.Run.1^3","e^zOnAfterSaveResult+10^TestCoverage.Manager.1^1","d^zSaveResult+9^%UnitTest.Manager.1^1","d^zrealRunTestSuites+143^%UnitTest.Manager.1^1","e^zRunTestSuites+4^%UnitTest.Manager.1^1","d^zRunTestSuites+2^%UnitTest.Manager.1^1","e^zRunTest+1^%UnitTest.Manager.1^1","e^^^1"))))/* ERROR #5002: ObjectScript error: <VALUE OUT OF RANGE>zListToBit+5^TestCoverage.Procedures.1 */
stevelee12 commented 1 month ago

Hi @isc-tleavitt - any update on this one please? thanks 👍

stevelee12 commented 1 month ago

Hi Tim Just wondering if there’s any update or progress on this one please? Thanks!

isc-tleavitt commented 1 month ago

@stevelee12 Ah! Sorry for the delay. As a further debugging step, could you find the value of tBitPosition when the <VALUE OUT OF RANGE> error occurs?

isc-tleavitt commented 1 month ago

Another possibility on this could be:

ClassMethod ListToBit(pSource As %List) As %Binary [ SqlName = LIST_TO_BIT, SqlProc ]
{
    Set tResult = ""
    Set tPointer = 0
    While $ListNext(pSource,tPointer,tBitPosition) {
        If $Data(tBitPosition)#2 && (+tBitPosition > 0) {
            Set $Bit(tResult,+tBitPosition) = 1
        }
    }
    Quit tResult
}

I'm not sure how you would get tBitPosition = 0 as input to this, but per the docs that would explain the <VALUE OUT OF RANGE> issue.

isc-tleavitt commented 1 month ago

@stevelee12 I've tacked on that possible fix to the PR, which you can get via IPM by running: zpm "load https://github.com/intersystems/TestCoverage -b fix-54"

stevelee12 commented 1 month ago

Hi Tim Great stuff, I applied the fix via zpm and Testsuite now completes without error :) Thankyou!

stevelee12 commented 3 weeks ago

Hi Tim, any ETA for the pull request on this pls? its working! :) thanks

isc-tleavitt commented 3 weeks ago

@stevelee12 thanks for the reminder - merged + released 4.0.4 with the fix.

stevelee12 commented 2 weeks ago

Could you upload 4.0.4 on GitHub please? I load it onto my container via the TestCoverage-v4.0.X.xml file - thanks :)

isc-tleavitt commented 2 weeks ago

@stevelee12 good catch, sorry - see https://github.com/intersystems/TestCoverage/releases/tag/v4.0.4