Skip to content

Commit edd8db1

Browse files
committed
Made LogAssert restart the monitor when the call is from StartProduction()
1 parent 8f62ac2 commit edd8db1

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

cls/TestCoverage/Manager.cls

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ Property SourceNamespace As %String(MAXLEN = 255) [ Internal, Private ];
5050

5151
Property ProcessIDs As %List [ Internal, Private ];
5252

53-
Property InteroperabilityProcesses As %Boolean [ InitialExpression = 0, Internal, Private ];
53+
/// 0 means don't bother with interoperability processes, 1 means track interoperability processes
54+
Property InteroperabilityProcesses As %Integer [ InitialExpression = 0, Internal, Private ];
55+
56+
/// these next two make it easier to start the monitor again with the same parameters
57+
Property LastRelevantTargets As %List [ Internal, Private ];
58+
59+
Property LastMetrics As %List [ Internal, Private ];
5460

5561
Property Run As TestCoverage.Data.Run;
5662

@@ -180,9 +186,8 @@ Method CoverageTargetsSet(%value) As %Status [ Internal, Private ]
180186

181187
Method LogAssert(success, action, description, extra, args...)
182188
{
183-
set ^IRIS.TEMPCG($i(^IRIS.TEMPCG)) = "We're in LogAssert"
184189
do ##super(.success, .action, .description, .extra, args...)
185-
if (..InteroperabilityProcesses) {
190+
if (..InteroperabilityProcesses && (description = "StartProduction()")) {
186191
// Collect the list of PIDs used by Interoperability processes in the current namespace
187192
// Run unit tests collecting coverage in that specific list of processes (plus the current process)
188193
&sql(select %DLIST(Process) into :tProcessIDs from %SYS.ProcessQuery_SS() where "User" = '_Ensemble')
@@ -194,6 +199,7 @@ Method LogAssert(success, action, description, extra, args...)
194199
}
195200
set ..ProcessIDs = tProcessIDs
196201
set ^IRIS.TEMPCG($i(^IRIS.TEMPCG)) = tProcessIDs
202+
$$$ThrowOnError(..Monitor.StartWithScope(..LastRelevantTargets, ..LastMetrics, tProcessIDs))
197203
}
198204
}
199205

@@ -278,6 +284,8 @@ Method StartCoverageTracking() As %Status [ Private ]
278284
}
279285
// set ^IRIS.TEMPCG($i(^IRIS.TEMPCG)) = tProcessIDs
280286
Set tMetrics = $ListBuild("RtnLine") _ $Select(..Timing:$ListBuild("Time","TotalTime"),1:"")
287+
Set ..LastRelevantTargets = tRelevantTargets
288+
Set ..LastMetrics = tMetrics
281289
$$$ThrowOnError(..Monitor.StartWithScope(tRelevantTargets,tMetrics,tProcessIDs))
282290
}
283291
} Catch e {

0 commit comments

Comments
 (0)