Frontend gaps fill work. Testing fixes work. Auditing in progress.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FsCheck.Xunit" />
|
||||
<PackageReference Include="FsCheck.Xunit.v3" />
|
||||
<PackageReference Include="FsCheck" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" >
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
@@ -30,4 +30,6 @@
|
||||
<ProjectReference Include="..\\..\\StellaOps.Attestor.Envelope.csproj" />
|
||||
<ProjectReference Include="../../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class PostgresRekorSubmissionQueueIntegrationTests : IAsyncLifetime
|
||||
private FakeTimeProvider _timeProvider = null!;
|
||||
private AttestorMetrics _metrics = null!;
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_postgres = new PostgreSqlBuilder()
|
||||
.WithImage("postgres:16-alpine")
|
||||
@@ -66,7 +66,7 @@ public class PostgresRekorSubmissionQueueIntegrationTests : IAsyncLifetime
|
||||
NullLogger<PostgresRekorSubmissionQueue>.Instance);
|
||||
}
|
||||
|
||||
public async Task DisposeAsync()
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
await _dataSource.DisposeAsync();
|
||||
await _postgres.DisposeAsync();
|
||||
@@ -401,3 +401,6 @@ internal sealed class FakeTimeProvider : TimeProvider
|
||||
|
||||
public void SetTime(DateTimeOffset time) => _now = time;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Using Include="Xunit.Abstractions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup> </ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BouncyCastle.Cryptography" />
|
||||
<PackageReference Include="FluentAssertions" />
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,4 +32,5 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user