Skip to content

Commit 959a61c

Browse files
committed
Cleaned up some debugging variables, got rid of unused property variables, and added namespace to the query for processes
1 parent a73b278 commit 959a61c

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

cls/TestCoverage/Manager.cls

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ Property ProcessIDs As %List [ Internal, Private ];
5353
/// 0 means don't bother with interoperability processes, 1 means track interoperability processes
5454
Property InteroperabilityProcesses As %Integer [ InitialExpression = 0, Internal, Private ];
5555

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 ];
60-
6156
Property Run As TestCoverage.Data.Run;
6257

6358
/// Known coverage targets (already snapshotted). <br />
@@ -81,7 +76,7 @@ Property Monitor As TestCoverage.Utils.LineByLineMonitor [ InitialExpression = {
8176
/// Note that overall tracking is always available; more granular tracking requires more time and disk space.</li>
8277
/// <li><var>pLogIndex</var> (optional) allows for aggregation of code coverage results across unit test runs. To use this, get it back as output from the first test run, then pass it to the next.</li>
8378
/// <li><var>pSourceNamespace</var> (optional) specifies the namespace in which classes were compiled, defaulting to the current namespace. This may be required to retrieve some metadata.</li>
84-
/// <li><var>pPIDList</var> (optional) has a $ListBuild list of process IDs to monitor. If this is empty, all processes are monitored. By default, this is just the current process.</li>
79+
/// <li><var>pPIDList</var> (optional) has a $ListBuild list of process IDs to monitor. If this is empty, all processes are monitored. If this is $listbuild("Interop"), the current process and all interoperability processes are monitored. By default, this is just the current process.</li>
8580
/// <li><var>pTiming</var> (optional) may be set to 1 to also collect timing information per line.</li>
8681
/// </ul>
8782
/// 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>.
@@ -184,24 +179,24 @@ Method CoverageTargetsSet(%value) As %Status [ Internal, Private ]
184179
Quit $$$OK
185180
}
186181

182+
/// Overriden LogAssert method because we want to be able to hook into the StartProduction() call in subclasses of %UnitTest.TestProduction
183+
/// in order to get the interoperability process list after the production has started
187184
Method LogAssert(success, action, description, extra, args...)
188185
{
189186
do ##super(.success, .action, .description, .extra, args...)
190187
if (..InteroperabilityProcesses && (description = "StartProduction()")) {
191188
// Collect the list of PIDs used by Interoperability processes in the current namespace
192189
// Run unit tests collecting coverage in that specific list of processes (plus the current process)
193-
&sql(select %DLIST(Process) into :tProcessIDs from %SYS.ProcessQuery_SS() where "User" = '_Ensemble')
190+
&sql(select %DLIST(Process) into :tProcessIDs from %SYS.ProcessQuery_SS() where "User" = '_Ensemble' and Namespace = $Namespace)
194191
If (SQLCODE < 0) {
195192
Throw ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE,%msg)
196193
}
197194
if ('$LISTFIND(tProcessIDs, $Job)) {
198195
set $LIST(tProcessIDs, *+1) = $Job
199196
}
200197
set ..ProcessIDs = tProcessIDs
201-
set ^IRIS.TEMPCG($i(^IRIS.TEMPCG)) = $lb("inside logassert", tProcessIDs)
202198
$$$ThrowOnError(..EndCoverageTracking())
203199
$$$ThrowOnError(..StartCoverageTracking())
204-
// $$$ThrowOnError(..Monitor.StartWithScope(..LastRelevantTargets, ..LastMetrics, tProcessIDs))
205200
}
206201
}
207202

@@ -273,21 +268,17 @@ Method StartCoverageTracking() As %Status [ Private ]
273268
}
274269
ElseIf ($list(tProcessIDs, 1)="Interop")
275270
{
276-
// set ^IRIS.TEMPCG($i(^IRIS.TEMPCG)) = "ProcessIDs was still Interop"
277271
// Collect the list of PIDs used by Interoperability processes in the current namespace
278272
// Run unit tests collecting coverage in that specific list of processes (plus the current process)
279-
&sql(select %DLIST(Process) into :tProcessIDs from %SYS.ProcessQuery_SS() where "User" = '_Ensemble')
273+
&sql(select %DLIST(Process) into :tProcessIDs from %SYS.ProcessQuery_SS() where "User" = '_Ensemble' and Namespace = $Namespace)
280274
If (SQLCODE < 0) {
281275
Throw ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE,%msg)
282276
}
283277
if ('$LISTFIND(tProcessIDs, $Job)) {
284278
set $LIST(tProcessIDs, *+1) = $Job
285279
}
286280
}
287-
set ^IRIS.TEMPCG($i(^IRIS.TEMPCG)) = tProcessIDs
288281
Set tMetrics = $ListBuild("RtnLine") _ $Select(..Timing:$ListBuild("Time","TotalTime"),1:"")
289-
Set ..LastRelevantTargets = tRelevantTargets
290-
Set ..LastMetrics = tMetrics
291282
$$$ThrowOnError(..Monitor.StartWithScope(tRelevantTargets,tMetrics,tProcessIDs))
292283
}
293284
} Catch e {

0 commit comments

Comments
 (0)