Merge branch 'main' of https://git.stella-ops.org/stella-ops.org/git.stella-ops.org
This commit is contained in:
@@ -360,6 +360,7 @@ public sealed class GatewayActivationTests
|
||||
|
||||
using var client = factory.CreateClient();
|
||||
|
||||
using StellaOps.TestKit;
|
||||
try
|
||||
{
|
||||
var response = await client.PostAsJsonAsync(
|
||||
|
||||
@@ -70,6 +70,7 @@ public class PolicyEngineClientTests
|
||||
{
|
||||
using var metrics = new PolicyGatewayMetrics();
|
||||
using var listener = new MeterListener();
|
||||
using StellaOps.TestKit;
|
||||
var measurements = new List<(long Value, string Outcome, string Source)>();
|
||||
var latencies = new List<(double Value, string Outcome, string Source)>();
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ public sealed class PolicyGatewayDpopProofGeneratorTests
|
||||
private static string CreateEcKey(DirectoryInfo directory, ECCurve curve)
|
||||
{
|
||||
using var ecdsa = ECDsa.Create(curve);
|
||||
using StellaOps.TestKit;
|
||||
var privateKey = ecdsa.ExportPkcs8PrivateKey();
|
||||
var pem = PemEncoding.Write("PRIVATE KEY", privateKey);
|
||||
var path = Path.Combine(directory.FullName, "policy-gateway-dpop.pem");
|
||||
|
||||
@@ -73,6 +73,7 @@ public class RiskProfileCanonicalizerTests
|
||||
|
||||
var merged = RiskProfileCanonicalizer.Merge(baseProfile, overlay);
|
||||
using var doc = JsonDocument.Parse(merged);
|
||||
using StellaOps.TestKit;
|
||||
var root = doc.RootElement;
|
||||
|
||||
Assert.Equal(2, root.GetProperty("signals").GetArrayLength());
|
||||
|
||||
@@ -80,6 +80,7 @@ public sealed class CvssPolicyLoaderTests
|
||||
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
using var finalDoc = JsonDocument.Parse(stream);
|
||||
using StellaOps.TestKit;
|
||||
return finalDoc.RootElement.Clone();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public sealed class PostgresExceptionApplicationRepositoryTests : IAsyncLifetime
|
||||
|
||||
// Set search path to include the test schema
|
||||
await using var conn = await _dataSource.OpenConnectionAsync();
|
||||
using StellaOps.TestKit;
|
||||
await using var cmd = new NpgsqlCommand($"SET search_path TO {_fixture.SchemaName}, public;", conn);
|
||||
await cmd.ExecuteNonQueryAsync();
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public sealed class RecheckEvidenceMigrationTests : IAsyncLifetime
|
||||
private static async Task AssertTableExistsAsync(NpgsqlConnection connection, string tableName)
|
||||
{
|
||||
await using var command = new NpgsqlCommand("SELECT to_regclass(@name)", connection);
|
||||
using StellaOps.TestKit;
|
||||
command.Parameters.AddWithValue("name", tableName);
|
||||
var result = await command.ExecuteScalarAsync();
|
||||
result.Should().NotBeNull($"{tableName} should exist after migrations");
|
||||
|
||||
@@ -64,6 +64,7 @@ public sealed class UnknownsRepositoryTests : IAsyncLifetime
|
||||
public async Task UpdateAsync_PersistsReasonCodeAndAssumptions()
|
||||
{
|
||||
await using var connection = await _dataSource.OpenConnectionAsync(_tenantId.ToString());
|
||||
using StellaOps.TestKit;
|
||||
var repository = new UnknownsRepository(connection);
|
||||
var now = new DateTimeOffset(2025, 2, 3, 4, 5, 6, TimeSpan.Zero);
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@ public sealed class PolicyBinderTests
|
||||
{
|
||||
using var output = new StringWriter();
|
||||
using var error = new StringWriter();
|
||||
using StellaOps.TestKit;
|
||||
var cli = new PolicyValidationCli(output, error);
|
||||
var options = new PolicyValidationCliOptions
|
||||
{
|
||||
|
||||
@@ -60,6 +60,7 @@ public sealed class PolicyScoringConfigTests
|
||||
using var stream = assembly.GetManifestResourceStream("StellaOps.Policy.Schemas.policy-scoring-default.json")
|
||||
?? throw new InvalidOperationException("Unable to locate embedded scoring default resource.");
|
||||
using var reader = new StreamReader(stream);
|
||||
using StellaOps.TestKit;
|
||||
var json = reader.ReadToEnd();
|
||||
|
||||
var binding = PolicyScoringConfigBinder.Bind(json, PolicyDocumentFormat.Json);
|
||||
|
||||
@@ -44,6 +44,7 @@ public class PolicyValidationCliTests
|
||||
|
||||
using var output = new StringWriter();
|
||||
using var error = new StringWriter();
|
||||
using StellaOps.TestKit;
|
||||
var cli = new PolicyValidationCli(output, error);
|
||||
|
||||
var exit = await cli.RunAsync(options);
|
||||
|
||||
@@ -61,6 +61,7 @@ public class SplLayeringEngineTests
|
||||
var merged = SplLayeringEngine.Merge(baseDoc, overlay);
|
||||
|
||||
using var doc = JsonDocument.Parse(merged);
|
||||
using StellaOps.TestKit;
|
||||
var root = doc.RootElement;
|
||||
|
||||
Assert.True(root.TryGetProperty("extras", out var extras) && extras.TryGetProperty("foo", out var foo) && foo.GetInt32() == 1);
|
||||
|
||||
@@ -14,6 +14,7 @@ public class SplSchemaResourceTests
|
||||
{
|
||||
var schema = SplSchemaResource.GetSchema();
|
||||
using var doc = JsonDocument.Parse(schema);
|
||||
using StellaOps.TestKit;
|
||||
var match = doc.RootElement
|
||||
.GetProperty("properties")
|
||||
.GetProperty("spec")
|
||||
|
||||
Reference in New Issue
Block a user