You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally speaking, set `^UnitTestRoot`, and then call `##class(TestCoverage.Manager).RunTest()` the same you would call `##class(%UnitTest.Manager).RunTest()`. For more information on InterSystems' %UnitTest framework, see the [tutorial](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=TUNT) and/or the [class reference for %UnitTest.Manager](https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25UnitTest.Manager).
59
59
60
-
The "userparam" argument can be used to pass information about code coverage data collection. For example:
60
+
The "userparam" argument can be used to pass optional information about code coverage data collection. For example:
61
61
62
62
```
63
63
Set tCoverageParams("CoverageClasses") = <$ListBuild list or %DynamicArray of class names for which code coverage data should be collected>
64
64
Set tCoverageParams("CoverageRoutines") = <$ListBuild list or %DynamicArray of routine names for which code coverage data should be collected>
65
65
Set tCoverageParams("CoverageDetail") = <0 to track code coverage overall; 1 to track it per test suite (the default); 2 to track it per test class; 3 to track it per test method.>
66
+
Set tCoverageParams("ProcessIDs") = <$ListBuild list of process IDs to monitor, or "Interoperability">
67
+
Set tCoverageParams("Timing") = <1 to capture timing data, 0 to not>
68
+
Set tCoverageParams("PyModules") = <$ListBuild list of Python module names to preload>
69
+
Set tCoverageParams("ListenerManager") = <instance of TestCoverage.Listeners.ListenerManager>)
66
70
Do ##class(TestCoverage.Manager).RunTest(,,.tCoverageParams)
67
71
```
68
72
@@ -96,6 +100,9 @@ Where:
96
100
*`tSourceNamespace` (optional) specifies the namespace in which classes were compiled, defaulting to the current namespace. This may be required to retrieve some metadata.
97
101
*`tPIDList` (optional) has a $ListBuild list of process IDs to monitor. If this is empty, all processes are monitored. If this is $ListBuild("Interop") or "Interoperability", all interoperability processes and the current process are monitored. By default, only the current process is monitored.
98
102
*`tTiming` (optional) is 1 to capture execution time data for monitored classes/routines as well, or 0 (the default) to not capture this data.
103
+
*`tListenerManager` (optional) is an instance of TestCoverage.Listeners.ListenerManager that allows downstream applications to listen to the completion of unit test suites/cases/methods. It should use the AddListener method to populate with listeners that extend TestCoverage.Listeners.ListenerInterface. See [isc.perf.ui](https://github.com/intersystems/isc-perf-ui) for an example usage
104
+
*`tPyModules` a $ListBuild list of Python module names the covered code uses that should be imported before the unit tests are run. This is for modules like `pandas` and `sklearn`, whose import sometimes breaks sys.settrace
Copy file name to clipboardExpand all lines: cls/TestCoverage/Manager.cls
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ Property ListenerManager As TestCoverage.Listeners.ListenerManager;
95
95
/// </ul>
96
96
/// Granular data is stored in <class>TestCoverage.Data.Coverage</class>; aggregated data is stored per class in <class>TestCoverage.Data.Aggregate.ByCodeUnit</class> and for the whole run in <class>TestCoverage.Data.Aggregate.ByRun</class>.
0 commit comments