@@ -179,21 +179,27 @@ Method CoverageTargetsSet(%value) As %Status [ Internal, Private ]
179
179
Quit $$$OK
180
180
}
181
181
182
+ /// Collect the list of PIDs used by Interoperability processes in the current namespace
183
+ /// In order to run unit tests collecting coverage in that specific list of processes (plus the current process)
184
+ Method GetInteropProcesses (Output tProcessIDs )
185
+ {
186
+ &sql (select %DLIST(Process) into :tProcessIDs from %SYS .ProcessQuery _SS () where " User" = '_Ensemble ' and Namespace = $Namespace )
187
+ If (SQLCODE < 0 ) {
188
+ Throw ##class (%Exception.SQL ).CreateFromSQLCODE (SQLCODE ,%msg )
189
+ }
190
+ if ('$LISTFIND (tProcessIDs , $Job )) {
191
+ set $LIST (tProcessIDs , *+1 ) = $Job
192
+ }
193
+ }
194
+
182
195
/// Overriden LogAssert method because we want to be able to hook into the StartProduction() call in subclasses of %UnitTest.TestProduction
183
196
/// in order to get the interoperability process list after the production has started
184
197
Method LogAssert (success , action , description , extra , args ...)
185
198
{
186
199
do ##super (.success , .action , .description , .extra , args ...)
187
200
if (..InteroperabilityProcesses && (description = " StartProduction()" )) {
188
- // Collect the list of PIDs used by Interoperability processes in the current namespace
189
- // Run unit tests collecting coverage in that specific list of processes (plus the current process)
190
- &sql (select %DLIST(Process) into :tProcessIDs from %SYS .ProcessQuery _SS () where " User" = '_Ensemble ' and Namespace = $Namespace )
191
- If (SQLCODE < 0 ) {
192
- Throw ##class (%Exception.SQL ).CreateFromSQLCODE (SQLCODE ,%msg )
193
- }
194
- if ('$LISTFIND (tProcessIDs , $Job )) {
195
- set $LIST (tProcessIDs , *+1 ) = $Job
196
- }
201
+
202
+ do GetInteropProcesses (.tProcessIDs )
197
203
set ..ProcessIDs = tProcessIDs
198
204
$$$ThrowOnError(..EndCoverageTracking ())
199
205
$$$ThrowOnError(..StartCoverageTracking ())
@@ -268,15 +274,7 @@ Method StartCoverageTracking() As %Status [ Private ]
268
274
}
269
275
ElseIf ($list (tProcessIDs , 1 )=" Interop" )
270
276
{
271
- // Collect the list of PIDs used by Interoperability processes in the current namespace
272
- // Run unit tests collecting coverage in that specific list of processes (plus the current process)
273
- &sql (select %DLIST(Process) into :tProcessIDs from %SYS .ProcessQuery _SS () where " User" = '_Ensemble ' and Namespace = $Namespace )
274
- If (SQLCODE < 0 ) {
275
- Throw ##class (%Exception.SQL ).CreateFromSQLCODE (SQLCODE ,%msg )
276
- }
277
- if ('$LISTFIND (tProcessIDs , $Job )) {
278
- set $LIST (tProcessIDs , *+1 ) = $Job
279
- }
277
+ do GetInteropProcesses (.tProcessIDs )
280
278
}
281
279
Set tMetrics = $ListBuild (" RtnLine" ) _ $Select (..Timing :$ListBuild (" Time" ," TotalTime" ),1 :" " )
282
280
$$$ThrowOnError(..Monitor .StartWithScope (tRelevantTargets ,tMetrics ,tProcessIDs ))
0 commit comments