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:
@@ -23,7 +23,7 @@ using ZB.MOM.WW.ScadaBridge.Communication.Actors;
|
||||
namespace ZB.MOM.WW.ScadaBridge.IntegrationTests.AuditLog;
|
||||
|
||||
/// <summary>
|
||||
/// End-to-end integration test for the Audit Log (#23) site→central push path
|
||||
/// End-to-end integration test for the Audit Log site→central push path
|
||||
/// introduced by the "real site audit push client" follow-up.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -61,6 +61,7 @@ public class SiteAuditPushFlowTests : TestKit
|
||||
private readonly IActorRef _central;
|
||||
private readonly IActorRef _auditIngest;
|
||||
|
||||
/// <summary>Creates a transport that forwards each call to the supplied central actors.</summary>
|
||||
/// <param name="central">Stands in for the central control plane's non-audit RPCs.</param>
|
||||
/// <param name="auditIngest">
|
||||
/// The central audit-ingest singleton. The two ingest RPCs go straight here, mirroring
|
||||
@@ -73,12 +74,19 @@ public class SiteAuditPushFlowTests : TestKit
|
||||
_auditIngest = auditIngest;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SubmitNotification(NotificationSubmit message, IActorRef replyTo) => _central.Tell(message, replyTo);
|
||||
/// <inheritdoc />
|
||||
public void QueryNotificationStatus(NotificationStatusQuery message, IActorRef replyTo) => _central.Tell(message, replyTo);
|
||||
/// <inheritdoc />
|
||||
public void IngestAuditEvents(IngestAuditEventsCommand message, IActorRef replyTo) => _auditIngest.Tell(message, replyTo);
|
||||
/// <inheritdoc />
|
||||
public void IngestCachedTelemetry(IngestCachedTelemetryCommand message, IActorRef replyTo) => _auditIngest.Tell(message, replyTo);
|
||||
/// <inheritdoc />
|
||||
public void ReconcileSite(ReconcileSiteRequest message, IActorRef replyTo) => _central.Tell(message, replyTo);
|
||||
/// <inheritdoc />
|
||||
public void ReportSiteHealth(SiteHealthReport message, IActorRef replyTo) => _central.Tell(message, replyTo);
|
||||
/// <inheritdoc />
|
||||
public void SendHeartbeat(HeartbeatMessage message, IActorRef self) => _central.Tell(message, self);
|
||||
}
|
||||
|
||||
@@ -89,13 +97,16 @@ public class SiteAuditPushFlowTests : TestKit
|
||||
/// </summary>
|
||||
private sealed class InMemoryAuditLogRepository : IAuditLogRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<AuditEvent>> GetTraceEventsAsync(Guid executionId, CancellationToken ct = default, IReadOnlyList<string>? permittedSiteIds = null)
|
||||
=> throw new NotSupportedException("GetTraceEventsAsync is not exercised by this test double.");
|
||||
|
||||
private readonly ConcurrentDictionary<Guid, AuditEvent> _rows = new();
|
||||
|
||||
/// <summary>Gets a snapshot of all rows inserted so far.</summary>
|
||||
public IReadOnlyCollection<AuditEvent> Rows => _rows.Values.ToList();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task InsertIfNotExistsAsync(AuditEvent evt, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(evt);
|
||||
@@ -104,38 +115,46 @@ public class SiteAuditPushFlowTests : TestKit
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<AuditEvent>> QueryAsync(
|
||||
AuditLogQueryFilter filter, AuditLogPaging paging, CancellationToken ct = default)
|
||||
=> throw new NotSupportedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<long> SwitchOutPartitionAsync(DateTime monthBoundary, TimeSpan? commandTimeout = null, CancellationToken ct = default)
|
||||
=> throw new NotSupportedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<long> PurgeChannelOlderThanAsync(
|
||||
string channel, DateTime threshold, int batchSize, TimeSpan? commandTimeout = null, CancellationToken ct = default, int maxRows = 50_000)
|
||||
=> throw new NotSupportedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<long> BackfillSourceNodeAsync(
|
||||
string sentinel, DateTime before, int batchSize, CancellationToken ct = default)
|
||||
=> throw new NotSupportedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<DateTime>> GetPartitionBoundariesOlderThanAsync(
|
||||
DateTime threshold, CancellationToken ct = default)
|
||||
=> throw new NotSupportedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<AuditLogKpiSnapshot> GetKpiSnapshotAsync(
|
||||
TimeSpan window, DateTime? nowUtc = null, CancellationToken ct = default)
|
||||
=> throw new NotSupportedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<ExecutionTreeNode>> GetExecutionTreeAsync(
|
||||
Guid executionId, CancellationToken ct = default, IReadOnlyList<string>? permittedSiteIds = null)
|
||||
=> throw new NotSupportedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<string>> GetDistinctSourceNodesAsync(CancellationToken ct = default)
|
||||
=> throw new NotSupportedException();
|
||||
}
|
||||
|
||||
// C3 (Task 2.5): canonical record via the shared factory; ForwardState is a
|
||||
// Canonical record via the shared factory; ForwardState is a
|
||||
// site-storage-only concern (defaulted to Pending by the SQLite writer), not a
|
||||
// field on the canonical record.
|
||||
private static AuditEvent NewPendingEvent(Guid id) =>
|
||||
@@ -148,6 +167,8 @@ public class SiteAuditPushFlowTests : TestKit
|
||||
target: "ext-system-1",
|
||||
sourceSiteId: "site-1");
|
||||
|
||||
/// <summary>Verifies that a site audit event drains to central and the site row is flipped to forwarded.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task SiteAuditEvent_DrainsToCentral_AndFlipsSiteRowToForwarded()
|
||||
{
|
||||
@@ -233,7 +254,7 @@ public class SiteAuditPushFlowTests : TestKit
|
||||
// The site row reached AuditForwardState.Forwarded specifically —
|
||||
// not merely "no longer Pending" (a Reconciled row would also leave
|
||||
// ReadPendingAsync, so we assert the positive Forwarded state).
|
||||
// C3 (Task 2.5): ForwardState is a site-storage-only column, no longer a
|
||||
// ForwardState is a site-storage-only column, no longer a
|
||||
// field on the canonical record. ReadForwardedAsync only returns rows in
|
||||
// the Forwarded state, so a single match here proves the row reached it.
|
||||
var forwarded = await writer.ReadForwardedAsync(256, CancellationToken.None);
|
||||
|
||||
Reference in New Issue
Block a user