Frontend gaps fill work. Testing fixes work. Auditing in progress.

This commit is contained in:
StellaOps Bot
2025-12-30 01:22:58 +02:00
parent 1dc4bcbf10
commit 7a5210e2aa
928 changed files with 183942 additions and 3941 deletions

View File

@@ -22,7 +22,7 @@ public sealed class OciAttestationAttacherIntegrationTests : IAsyncLifetime
private IContainer _registry = null!;
private string _registryHost = null!;
public async Task InitializeAsync()
public async ValueTask InitializeAsync()
{
_registry = new ContainerBuilder()
.WithImage("registry:2")
@@ -34,7 +34,7 @@ public sealed class OciAttestationAttacherIntegrationTests : IAsyncLifetime
_registryHost = _registry.Hostname + ":" + _registry.GetMappedPublicPort(5000);
}
public async Task DisposeAsync()
public async ValueTask DisposeAsync()
{
await _registry.DisposeAsync();
}
@@ -65,7 +65,7 @@ public sealed class OciAttestationAttacherIntegrationTests : IAsyncLifetime
// result.Should().NotBeNull();
// result.AttestationDigest.Should().StartWith("sha256:");
await Task.CompletedTask;
await ValueTask.CompletedTask;
}
[Fact(Skip = "Requires registry push/pull implementation - placeholder for integration test")]
@@ -84,7 +84,7 @@ public sealed class OciAttestationAttacherIntegrationTests : IAsyncLifetime
// var attestations = await attacher.ListAsync(imageRef);
// attestations.Should().NotBeNull();
await Task.CompletedTask;
await ValueTask.CompletedTask;
}
[Fact(Skip = "Requires registry push/pull implementation - placeholder for integration test")]
@@ -105,7 +105,7 @@ public sealed class OciAttestationAttacherIntegrationTests : IAsyncLifetime
// var envelope = await attacher.FetchAsync(imageRef, predicateType);
// envelope.Should().NotBeNull();
await Task.CompletedTask;
await ValueTask.CompletedTask;
}
[Fact(Skip = "Requires registry push/pull implementation - placeholder for integration test")]
@@ -126,6 +126,9 @@ public sealed class OciAttestationAttacherIntegrationTests : IAsyncLifetime
// var result = await attacher.RemoveAsync(imageRef, attestationDigest);
// result.Should().BeTrue();
await Task.CompletedTask;
await ValueTask.CompletedTask;
}
}

View File

@@ -2,24 +2,30 @@
using FluentAssertions;
using Json.Schema;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Attestor.Types.Tests;
public sealed class SmartDiffSchemaValidationTests
{
[Trait("Category", TestCategories.Unit)]
[Fact]
public void SmartDiffSchema_ValidatesSamplePredicate()
private static readonly Lazy<JsonSchema> SmartDiffSchema = new(() =>
{
var schemaPath = Path.Combine(AppContext.BaseDirectory, "schemas", "stellaops-smart-diff.v1.schema.json");
File.Exists(schemaPath).Should().BeTrue($"schema file should be copied to '{schemaPath}'");
var schema = JsonSchema.FromText(File.ReadAllText(schemaPath), new BuildOptions
return JsonSchema.FromText(File.ReadAllText(schemaPath), new BuildOptions
{
SchemaRegistry = new SchemaRegistry()
});
});
private static JsonSchema LoadSchema() => SmartDiffSchema.Value;
[Trait("Category", TestCategories.Unit)]
[Fact]
public void SmartDiffSchema_ValidatesSamplePredicate()
{
var schema = LoadSchema();
using var doc = JsonDocument.Parse("""
{
"schemaVersion": "1.0.0",
@@ -79,14 +85,10 @@ public sealed class SmartDiffSchemaValidationTests
}
[Trait("Category", TestCategories.Unit)]
[Fact]
[Fact]
public void SmartDiffSchema_RejectsInvalidReachabilityClass()
{
var schemaPath = Path.Combine(AppContext.BaseDirectory, "schemas", "stellaops-smart-diff.v1.schema.json");
var schema = JsonSchema.FromText(File.ReadAllText(schemaPath), new BuildOptions
{
SchemaRegistry = new SchemaRegistry()
});
var schema = LoadSchema();
using var doc = JsonDocument.Parse("""
{
"schemaVersion": "1.0.0",
@@ -106,5 +108,4 @@ public sealed class SmartDiffSchemaValidationTests
result.IsValid.Should().BeFalse();
}
}
}

View File

@@ -32,4 +32,5 @@
<ItemGroup>
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>
</Project>