audit, advisories and doctors/setup work

This commit is contained in:
master
2026-01-13 18:53:39 +02:00
parent 9ca7cb183e
commit d7be6ba34b
811 changed files with 54242 additions and 4056 deletions

View File

@@ -13,7 +13,7 @@
<ProjectReference Include="..\__Libraries\StellaOps.Timeline.Core\StellaOps.Timeline.Core.csproj" />
<ProjectReference Include="..\..\__Libraries\StellaOps.Eventing\StellaOps.Eventing.csproj" />
<ProjectReference Include="..\..\__Libraries\StellaOps.HybridLogicalClock\StellaOps.HybridLogicalClock.csproj" />
<ProjectReference Include="..\..\__Libraries\StellaOps.Microservice\StellaOps.Microservice.csproj" />
<ProjectReference Include="..\..\Router\__Libraries\StellaOps.Microservice\StellaOps.Microservice.csproj" />
</ItemGroup>
<ItemGroup>

View File

@@ -15,15 +15,7 @@
<ProjectReference Include="..\..\..\__Libraries\StellaOps.HybridLogicalClock\StellaOps.HybridLogicalClock.csproj" />
</ItemGroup>
<ItemGroup> <PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ItemGroup>
<PackageReference Include="Moq" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />

View File

@@ -48,9 +48,9 @@ public sealed class TimelineQueryServiceTests
public async Task GetByCorrelationIdAsync_ReturnsEventsOrderedByHlc()
{
// Arrange
var hlc1 = new HlcTimestamp(1000, 0, "n1");
var hlc2 = new HlcTimestamp(1000, 1, "n1");
var hlc3 = new HlcTimestamp(2000, 0, "n1");
var hlc1 = new HlcTimestamp { PhysicalTime = 1000, LogicalCounter = 0, NodeId = "n1" };
var hlc2 = new HlcTimestamp { PhysicalTime = 1000, LogicalCounter = 1, NodeId = "n1" };
var hlc3 = new HlcTimestamp { PhysicalTime = 2000, LogicalCounter = 0, NodeId = "n1" };
await _eventStore.AppendAsync(CreateEvent("corr-1", "C", hlc3));
await _eventStore.AppendAsync(CreateEvent("corr-1", "A", hlc1));
@@ -70,9 +70,9 @@ public sealed class TimelineQueryServiceTests
public async Task GetByCorrelationIdAsync_FiltersByServices()
{
// Arrange
var hlc1 = new HlcTimestamp(1000, 0, "n1");
var hlc2 = new HlcTimestamp(2000, 0, "n1");
var hlc3 = new HlcTimestamp(3000, 0, "n1");
var hlc1 = new HlcTimestamp { PhysicalTime = 1000, LogicalCounter = 0, NodeId = "n1" };
var hlc2 = new HlcTimestamp { PhysicalTime = 2000, LogicalCounter = 0, NodeId = "n1" };
var hlc3 = new HlcTimestamp { PhysicalTime = 3000, LogicalCounter = 0, NodeId = "n1" };
await _eventStore.AppendAsync(CreateEvent("corr-1", "A", hlc1, "Scheduler"));
await _eventStore.AppendAsync(CreateEvent("corr-1", "B", hlc2, "AirGap"));
@@ -93,9 +93,9 @@ public sealed class TimelineQueryServiceTests
public async Task GetByCorrelationIdAsync_FiltersByKinds()
{
// Arrange
var hlc1 = new HlcTimestamp(1000, 0, "n1");
var hlc2 = new HlcTimestamp(2000, 0, "n1");
var hlc3 = new HlcTimestamp(3000, 0, "n1");
var hlc1 = new HlcTimestamp { PhysicalTime = 1000, LogicalCounter = 0, NodeId = "n1" };
var hlc2 = new HlcTimestamp { PhysicalTime = 2000, LogicalCounter = 0, NodeId = "n1" };
var hlc3 = new HlcTimestamp { PhysicalTime = 3000, LogicalCounter = 0, NodeId = "n1" };
await _eventStore.AppendAsync(CreateEvent("corr-1", "ENQUEUE", hlc1));
await _eventStore.AppendAsync(CreateEvent("corr-1", "EXECUTE", hlc2));
@@ -118,7 +118,7 @@ public sealed class TimelineQueryServiceTests
// Arrange
for (int i = 0; i < 10; i++)
{
await _eventStore.AppendAsync(CreateEvent("corr-1", $"E{i}", new HlcTimestamp(1000 + i, 0, "n1")));
await _eventStore.AppendAsync(CreateEvent("corr-1", $"E{i}", new HlcTimestamp { PhysicalTime = 1000 + i, LogicalCounter = 0, NodeId = "n1" }));
}
// Act
@@ -142,7 +142,7 @@ public sealed class TimelineQueryServiceTests
EventId = "e1",
CorrelationId = "corr-1",
Kind = "ENQUEUE",
THlc = new HlcTimestamp(1000, 0, "n1"),
THlc = new HlcTimestamp { PhysicalTime = 1000, LogicalCounter = 0, NodeId = "n1" },
TsWall = baseTime,
Service = "Scheduler",
Payload = "{}",
@@ -156,7 +156,7 @@ public sealed class TimelineQueryServiceTests
EventId = "e2",
CorrelationId = "corr-1",
Kind = "EXECUTE",
THlc = new HlcTimestamp(2000, 0, "n1"),
THlc = new HlcTimestamp { PhysicalTime = 2000, LogicalCounter = 0, NodeId = "n1" },
TsWall = baseTime.AddSeconds(1), // 1 second
Service = "Scheduler",
Payload = "{}",
@@ -170,7 +170,7 @@ public sealed class TimelineQueryServiceTests
EventId = "e3",
CorrelationId = "corr-1",
Kind = "COMPLETE",
THlc = new HlcTimestamp(3000, 0, "n1"),
THlc = new HlcTimestamp { PhysicalTime = 3000, LogicalCounter = 0, NodeId = "n1" },
TsWall = baseTime.AddSeconds(5), // 4 more seconds
Service = "Scheduler",
Payload = "{}",
@@ -196,7 +196,7 @@ public sealed class TimelineQueryServiceTests
public async Task GetCriticalPathAsync_EmptyForSingleEvent()
{
// Arrange
await _eventStore.AppendAsync(CreateEvent("corr-1", "ENQUEUE", new HlcTimestamp(1000, 0, "n1")));
await _eventStore.AppendAsync(CreateEvent("corr-1", "ENQUEUE", new HlcTimestamp { PhysicalTime = 1000, LogicalCounter = 0, NodeId = "n1" }));
// Act
var result = await _queryService.GetCriticalPathAsync("corr-1");
@@ -210,9 +210,9 @@ public sealed class TimelineQueryServiceTests
public async Task GetByServiceAsync_ReturnsEventsFromService()
{
// Arrange
await _eventStore.AppendAsync(CreateEvent("corr-1", "A", new HlcTimestamp(1000, 0, "n1"), "Scheduler"));
await _eventStore.AppendAsync(CreateEvent("corr-2", "B", new HlcTimestamp(2000, 0, "n1"), "AirGap"));
await _eventStore.AppendAsync(CreateEvent("corr-3", "C", new HlcTimestamp(3000, 0, "n1"), "Scheduler"));
await _eventStore.AppendAsync(CreateEvent("corr-1", "A", new HlcTimestamp { PhysicalTime = 1000, LogicalCounter = 0, NodeId = "n1" }, "Scheduler"));
await _eventStore.AppendAsync(CreateEvent("corr-2", "B", new HlcTimestamp { PhysicalTime = 2000, LogicalCounter = 0, NodeId = "n1" }, "AirGap"));
await _eventStore.AppendAsync(CreateEvent("corr-3", "C", new HlcTimestamp { PhysicalTime = 3000, LogicalCounter = 0, NodeId = "n1" }, "Scheduler"));
// Act
var result = await _queryService.GetByServiceAsync("Scheduler");
@@ -222,3 +222,5 @@ public sealed class TimelineQueryServiceTests
result.Events.All(e => e.Service == "Scheduler").Should().BeTrue();
}
}

View File

@@ -148,7 +148,7 @@ public sealed class ReplayOrchestratorIntegrationTests
EventId = $"{correlationId}-evt-{i:D4}",
CorrelationId = correlationId,
Kind = $"EVENT_{i}",
THlc = new HlcTimestamp(1000 + i, 0, "test-node"),
THlc = new HlcTimestamp { PhysicalTime = 1000 + i, LogicalCounter = 0, NodeId = "test-node" },
TsWall = baseTime.AddSeconds(i),
Service = "TestService",
Payload = $"{{\"index\": {i}}}",
@@ -161,3 +161,4 @@ public sealed class ReplayOrchestratorIntegrationTests
}
}
}

View File

@@ -16,15 +16,7 @@
<ProjectReference Include="..\..\..\__Libraries\StellaOps.HybridLogicalClock\StellaOps.HybridLogicalClock.csproj" />
</ItemGroup>
<ItemGroup> <PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
<PackageReference Include="Testcontainers.PostgreSql" />

View File

@@ -148,7 +148,7 @@ public sealed class TimelineApiIntegrationTests : IClassFixture<TimelineWebAppli
EventId = $"{correlationId}-evt-{i:D4}",
CorrelationId = correlationId,
Kind = $"EVENT_{i}",
THlc = new HlcTimestamp(1000 + i, 0, "test-node"),
THlc = new HlcTimestamp { PhysicalTime = 1000 + i, LogicalCounter = 0, NodeId = "test-node" },
TsWall = baseTime.AddSeconds(i),
Service = "TestService",
Payload = $"{{\"index\": {i}}}",
@@ -176,7 +176,7 @@ public sealed class TimelineApiIntegrationTests : IClassFixture<TimelineWebAppli
EventId = $"{correlationId}-evt-{i:D4}",
CorrelationId = correlationId,
Kind = $"EVENT_{i}",
THlc = new HlcTimestamp(1000 + i, 0, "test-node"),
THlc = new HlcTimestamp { PhysicalTime = 1000 + i, LogicalCounter = 0, NodeId = "test-node" },
TsWall = baseTime.AddSeconds(i),
Service = services[i],
Payload = $"{{\"index\": {i}}}",
@@ -211,3 +211,4 @@ public sealed class TimelineWebApplicationFactory : WebApplicationFactory<Progra
/// Minimal Program class reference for WebApplicationFactory.
/// </summary>
public partial class Program { }