docs(tests): fix CommentChecker findings across tests/ — 13,392 → 0 (repo-wide scan clean)

Comment/XML-doc changes only:
- add summaries to ~10k test methods, fixtures, fakes and helpers
  (+ <param> on theories, <returns> on async Task methods,
  <inheritdoc/> on interface implementations the checker can resolve)
- strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N,
  #NN, Component-0NN) from comments, keeping the explanatory text;
  reword false positives in comments only
- real docs on fakes implementing BCL/library interfaces
  (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime)
- reword the last 5 src/ false positives (CWE-1236, failures-1,
  year-0001, M365)

Only non-comment edits: four one-line nested classes split across lines
so members can carry docs. Build 0 errors / 0 warnings.
This commit is contained in:
Joseph Doherty
2026-10-07 15:05:49 -04:00
parent 0ffd4bdbea
commit 513fa1aa16
998 changed files with 17896 additions and 2395 deletions
@@ -55,7 +55,7 @@ public class SiteAuditTelemetryActorTests : TestKit
(IOperationTrackingStore?)null)));
/// <summary>
/// AuditLog-001: builds an actor with the optional
/// Builds an actor with the optional
/// <see cref="IOperationTrackingStore"/> wired in so the cached-drain
/// scheduler is armed alongside the audit-only drain. Used by the new
/// cached-drain regression tests below.
@@ -86,6 +86,9 @@ public class SiteAuditTelemetryActorTests : TestKit
return ack;
}
/// <summary>Verifies that a drain of large rows stays within the wire budget and does not acknowledge rows that were not sent.</summary>
/// <param name="cached"><c>true</c> to drain cached-call rows, <c>false</c> to drain audit-only rows.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
[Theory]
[InlineData(false)]
[InlineData(true)]
@@ -126,6 +129,8 @@ public class SiteAuditTelemetryActorTests : TestKit
Assert.Equal(256, sent.Count);
}
/// <summary>Verifies that a drain of 50 pending rows sends one batch of 50 and then marks the rows as forwarded.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Drain_With_50PendingRows_Sends_OneBatch_Of_50_Then_FlipsToForwarded()
{
@@ -166,6 +171,8 @@ public class SiteAuditTelemetryActorTests : TestKit
Arg.Any<CancellationToken>());
}
/// <summary>Verifies that rows stay pending when the gRPC call throws and the next drain retries them.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Drain_GrpcThrows_RowsStayPending_NextDrainRetries()
{
@@ -206,6 +213,8 @@ public class SiteAuditTelemetryActorTests : TestKit
Assert.True(calls >= 2, $"Expected at least 2 client calls (1 failure + 1 retry); saw {calls}");
}
/// <summary>Verifies that a drain with no pending rows schedules the next drain at the idle interval without calling the client.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Drain_ZeroPending_SchedulesAtIdleInterval_NoClientCall()
{
@@ -230,6 +239,8 @@ public class SiteAuditTelemetryActorTests : TestKit
Assert.InRange(readCalls, 1, 2);
}
/// <summary>Verifies that a drain that finds pending rows schedules the next drain at the busy interval.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Drain_NonZeroPending_SchedulesAtBusyInterval()
{
@@ -254,6 +265,8 @@ public class SiteAuditTelemetryActorTests : TestKit
$"Expected ≥2 pushes within 3s when busy=1s; saw {pushCalls}");
}
/// <summary>Verifies that only the event ids the central ack accepted are marked as forwarded.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Drain_AcceptedEventIdsSubset_OnlyMarksAccepted()
{
@@ -292,7 +305,7 @@ public class SiteAuditTelemetryActorTests : TestKit
}
// ────────────────────────────────────────────────────────────────────────
// AuditLog-001: combined-telemetry cached-drain regression tests. Verify
// Combined-telemetry cached-drain regression tests. Verify
// that the production wiring of the previously-unreachable cached transport
// routes cached rows through ReadPendingCachedTelemetryAsync +
// IngestCachedTelemetryAsync (and NOT IngestAuditEventsAsync), and that
@@ -305,7 +318,7 @@ public class SiteAuditTelemetryActorTests : TestKit
Guid? eventId = null,
Guid? correlationId = null,
string sourceSiteId = "site-1") =>
// C3 (Task 2.5): canonical record via the shared factory; ForwardState is
// Canonical record via the shared factory; ForwardState is
// no longer a record field (the SQLite shim defaults it on INSERT).
ScadaBridgeAuditEventFactory.Create(
channel: AuditChannel.ApiOutbound,
@@ -335,12 +348,14 @@ public class SiteAuditTelemetryActorTests : TestKit
SourceScript: "script-1",
SourceNode: "node-a");
/// <summary>Verifies that cached rows are sent through the cached-telemetry RPC rather than the audit-events RPC.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task CachedDrain_CachedRows_RouteThrough_IngestCachedTelemetry_NotIngestAuditEvents()
{
// Arrange — three cached audit rows on the cached queue, each with a
// matching tracking snapshot. The audit-only queue is empty (those
// rows are excluded by ReadPendingAsync after AuditLog-001).
// rows are excluded by ReadPendingAsync after the combined-telemetry change).
var cachedRows = new[]
{
NewCachedEvent(AuditKind.CachedSubmit),
@@ -401,6 +416,8 @@ public class SiteAuditTelemetryActorTests : TestKit
Assert.Equal(expectedIds, emittedEventIds);
}
/// <summary>Verifies that a cached row with no tracking snapshot past the grace period is abandoned while a valid row still flows.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task CachedDrain_OrphanRow_PastGrace_IsAbandoned_AndTheValidRowStillFlows()
{
@@ -494,6 +511,8 @@ public class SiteAuditTelemetryActorTests : TestKit
Assert.Equal(valid.EventId.ToString(), capturedBatch.Packets[0].AuditEvent.EventId);
}
/// <summary>Verifies that a cached row with no tracking snapshot inside the grace period is retried rather than abandoned.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task CachedDrain_OrphanRow_InsideGrace_IsRetried_NotAbandoned()
{
@@ -536,6 +555,8 @@ public class SiteAuditTelemetryActorTests : TestKit
Arg.Any<IReadOnlyList<Guid>>(), Arg.Any<CancellationToken>());
}
/// <summary>Verifies that a full batch of unresolvable cached rows does not starve the rest of the queue.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task CachedDrain_FullBatchOfUnresolvableRows_DoesNotStarveTheQueue()
{
@@ -575,6 +596,8 @@ public class SiteAuditTelemetryActorTests : TestKit
Arg.Any<CachedTelemetryBatch>(), Arg.Any<CancellationToken>());
}
/// <summary>Verifies that a tracking-store failure does not cause the cached row to be abandoned.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task CachedDrain_TrackingStoreThrow_DoesNotAbandonTheRow()
{
@@ -608,13 +631,15 @@ public class SiteAuditTelemetryActorTests : TestKit
Arg.Any<IReadOnlyList<Guid>>(), Arg.Any<CancellationToken>());
}
/// <summary>Verifies that audit-only rows still drain when the cached drain is disabled.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task AuditOnlyDrain_StillFlows_When_CachedDrain_IsDisabled()
{
// Arrange — ordinary (non-cached) audit rows on the audit-only queue;
// the actor is constructed WITHOUT a tracking store so the cached
// scheduler is never armed. Regression guard against the audit-only
// drain regressing during the AuditLog-001 refactor.
// drain regressing during the combined-telemetry refactor.
var rows = Enumerable.Range(0, 3).Select(_ => NewEvent()).ToList();
_queue.ReadPendingAsync(Arg.Any<int>(), Arg.Any<CancellationToken>())
.Returns(
@@ -655,6 +680,7 @@ public class SiteAuditTelemetryActorTests : TestKit
/// test in this class masks the bug by returning already-completed tasks
/// from the mocks, which keeps the continuations on the actor thread.
/// </summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Drains_Whose_Awaits_Complete_Off_The_Actor_Thread_Keep_Draining_Without_Crashing()
{