This commit is contained in:
StellaOps Bot
2025-12-26 21:43:56 +02:00
354 changed files with 354 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ public class DsseVerifierTests
public void VerifiesRsaPssSignature()
{
using var rsa = RSA.Create(2048);
using StellaOps.TestKit;
var pub = rsa.ExportSubjectPublicKeyInfo();
var payload = "hello-world";
var payloadType = "application/vnd.stella.bundle";

View File

@@ -66,6 +66,7 @@ public sealed class ImportValidatorTests
var timestamp = "{\"version\":1,\"expiresUtc\":\"2030-01-01T00:00:00Z\",\"snapshot\":{\"meta\":{\"hashes\":{\"sha256\":\"abc\"}}}}";
using var rsa = RSA.Create(2048);
using StellaOps.TestKit;
var pub = rsa.ExportSubjectPublicKeyInfo();
var payload = "bundle-body";

View File

@@ -102,6 +102,7 @@ public sealed class OfflineKitMetricsTests : IDisposable
{
using var metrics = new OfflineKitMetrics();
using StellaOps.TestKit;
metrics.RecordRekorInclusionLatency(seconds: 0.5, success: false);
Assert.Contains(_measurements, m =>

View File

@@ -60,6 +60,7 @@ public sealed class SbomIngestServiceCollectionExtensionsTests : IDisposable
services.AddSbomIngestPipeline();
using var provider = services.BuildServiceProvider();
using StellaOps.TestKit;
var processor = provider.GetRequiredService<SbomIngestProcessor>();
var snapshot = LoadSnapshot();

View File

@@ -23,6 +23,7 @@ public sealed class ToolEntrypointTests
var payload = Encoding.UTF8.GetBytes("payload");
var key = Convert.ToHexString(Encoding.UTF8.GetBytes("secret"));
using var hmac = new System.Security.Cryptography.HMACSHA256(Encoding.UTF8.GetBytes("secret"));
using StellaOps.TestKit;
var sig = Convert.ToHexString(hmac.ComputeHash(payload));
var tmp = Path.GetTempFileName();

View File

@@ -70,6 +70,7 @@ public sealed class VerificationLibraryTests
};
using var sha = System.Security.Cryptography.SHA256.Create();
using StellaOps.TestKit;
var aggregate = sha.ComputeHash(Array.Empty<byte>().Concat(hops[0]).ToArray());
aggregate = sha.ComputeHash(aggregate.Concat(hops[1]).ToArray());

View File

@@ -108,6 +108,7 @@ public sealed class RequestDispatcherTests
services.AddTransient<GetItemHandler>();
using var provider = services.BuildServiceProvider();
using StellaOps.TestKit;
var dispatcher = new RequestDispatcher(
registry,
provider,

View File

@@ -195,6 +195,7 @@ public class TypedEndpointAdapterTests
response.Body.Position = 0;
using var reader = new StreamReader(response.Body);
using StellaOps.TestKit;
return await reader.ReadToEndAsync();
}
}

View File

@@ -331,6 +331,7 @@ routing:
var logger = NullLogger<RouterConfigProvider>.Instance;
using var provider = new RouterConfigProvider(options, logger);
using StellaOps.TestKit;
provider.Current.Routing.LocalRegion.Should().Be("eu1");
// Act - update file and manually reload

View File

@@ -179,6 +179,7 @@ public sealed class MiddlewareErrorScenarioTests
{
context.Response.Body.Position = 0;
using var doc = JsonDocument.Parse(context.Response.Body);
using StellaOps.TestKit;
return doc.RootElement.Clone();
}

View File

@@ -89,6 +89,7 @@ public sealed class RateLimitMiddlewareTests
var body = await new StreamReader(context.Response.Body, Encoding.UTF8).ReadToEndAsync();
using var json = JsonDocument.Parse(body);
using StellaOps.TestKit;
json.RootElement.GetProperty("error").GetString().Should().Be("rate_limit_exceeded");
json.RootElement.GetProperty("scope").GetString().Should().Be("environment");
json.RootElement.GetProperty("limit").GetInt64().Should().Be(1);

View File

@@ -35,6 +35,7 @@ public sealed class RouterNodeConfigValidationTests
using var provider = services.BuildServiceProvider();
using StellaOps.TestKit;
var config = provider.GetRequiredService<IOptions<RouterNodeConfig>>().Value;
config.Region.Should().Be("test");

View File

@@ -99,6 +99,7 @@ public class InMemoryChannelTests
{
// Arrange
using var channel = new InMemoryChannel("test-1");
using StellaOps.TestKit;
var instance = new InstanceDescriptor
{
InstanceId = "inst-1",

View File

@@ -88,6 +88,7 @@ public class InMemoryConnectionRegistryTests
// Arrange
using var registry = new InMemoryConnectionRegistry();
using StellaOps.TestKit;
// Act
var removed = registry.RemoveChannel("unknown");

View File

@@ -72,6 +72,7 @@ public class StreamingFlowTests
var testData = Encoding.UTF8.GetBytes("Test streaming data");
using var requestBody = new MemoryStream(testData);
using StellaOps.TestKit;
Func<Stream, Task> readResponse = _ => Task.CompletedTask;
// Act - this will send header + data frames

View File

@@ -495,6 +495,7 @@ public class UdpTransportTests
});
await using var provider = services.BuildServiceProvider();
using StellaOps.TestKit;
var server = provider.GetRequiredService<UdpTransportServer>();
var client = provider.GetRequiredService<UdpTransportClient>();

View File

@@ -74,6 +74,7 @@ public class CorpusFixtureTests
File.Exists(truthPath).Should().BeTrue($"{id} missing ground-truth.json");
using var truthDoc = JsonDocument.Parse(File.ReadAllBytes(truthPath));
using StellaOps.TestKit;
truthDoc.RootElement.GetProperty("schema_version").GetString().Should().Be(expectedSchemaVersion, $"{id} ground-truth schema_version mismatch");
truthDoc.RootElement.GetProperty("case_id").GetString().Should().Be(id, $"{id} ground-truth case_id must match manifest id");

View File

@@ -52,6 +52,7 @@ public sealed class FixtureCoverageTests
File.Exists(manifestPath).Should().BeTrue($"{manifestPath} should exist");
using var doc = JsonDocument.Parse(File.ReadAllBytes(manifestPath));
using StellaOps.TestKit;
return doc.RootElement.EnumerateArray()
.Select(entry => $"{entry.GetProperty("language").GetString()}/{entry.GetProperty("id").GetString()}")
.ToArray();

View File

@@ -66,6 +66,7 @@ public class ReachbenchEvaluationHarnessTests
File.Exists(truthPath).Should().BeTrue();
using var truthDoc = JsonDocument.Parse(File.ReadAllBytes(truthPath));
using StellaOps.TestKit;
var paths = truthDoc.RootElement.GetProperty("paths");
paths.ValueKind.Should().Be(JsonValueKind.Array, $"{caseId}:{variant} should list truth paths as an array");
return paths.GetArrayLength();

View File

@@ -148,6 +148,7 @@ public class ReachbenchFixtureTests
var manifestPath = Path.Combine(variantPath, "manifest.json");
using var manifestStream = File.OpenRead(manifestPath);
using var manifestDoc = JsonDocument.Parse(manifestStream);
using StellaOps.TestKit;
var files = manifestDoc.RootElement.GetProperty("files");
foreach (var file in requiredFiles.Where(f => f != "manifest.json"))

View File

@@ -30,6 +30,7 @@ public class SamplesPublicFixtureTests
using var stream = File.OpenRead(manifestPath);
using var doc = JsonDocument.Parse(stream);
using StellaOps.TestKit;
doc.RootElement.ValueKind.Should().Be(JsonValueKind.Array);
var keys = doc.RootElement.EnumerateArray()

View File

@@ -50,6 +50,7 @@ public sealed class ReplayBundleWriterTests
{
names.Add(entry.Name);
using var ms = new MemoryStream();
using StellaOps.TestKit;
entry.DataStream!.CopyTo(ms);
var text = System.Text.Encoding.UTF8.GetString(ms.ToArray());
text.Should().Be(entry.Name.StartsWith("a") ? "alpha" : "beta");

View File

@@ -330,6 +330,7 @@ public sealed class ScannerToSignalsReachabilityTests
if (request.ManifestContent is not null)
{
await using var manifestBuffer = new MemoryStream();
using StellaOps.TestKit;
await request.ManifestContent.CopyToAsync(manifestBuffer, cancellationToken).ConfigureAwait(false);
manifests[computedHash] = manifestBuffer.ToArray();
}

View File

@@ -145,6 +145,7 @@ public sealed class ReachabilityScoringTests
}
using var doc = JsonDocument.Parse(line);
using StellaOps.TestKit;
if (doc.RootElement.TryGetProperty("sid", out var sidProp))
{
runtimeHits.Add(sidProp.GetString()!);