Refactor code structure and optimize performance across multiple modules

This commit is contained in:
StellaOps Bot
2025-12-26 20:03:22 +02:00
parent c786faae84
commit f10d83c444
1385 changed files with 69732 additions and 10280 deletions

View File

@@ -6,13 +6,15 @@ using StellaOps.Scheduler.Models;
using StellaOps.Scheduler.WebService.GraphJobs;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Scheduler.WebService.Tests;
public sealed class GraphJobServiceTests
{
private static readonly DateTimeOffset FixedTime = new(2025, 11, 4, 12, 0, 0, TimeSpan.Zero);
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task CompleteBuildJob_PersistsMetadataAndPublishesOnce()
{
var store = new TrackingGraphJobStore();
@@ -50,7 +52,8 @@ public sealed class GraphJobServiceTests
Assert.Equal("oras://cartographer/bundle", resultUri);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task CompleteBuildJob_IsIdempotentWhenAlreadyCompleted()
{
var store = new TrackingGraphJobStore();
@@ -84,7 +87,8 @@ public sealed class GraphJobServiceTests
Assert.Single(webhook.Notifications);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task CompleteBuildJob_UpdatesResultUriWithoutReemittingEvent()
{
var store = new TrackingGraphJobStore();
@@ -131,7 +135,8 @@ public sealed class GraphJobServiceTests
Assert.Equal("oras://cartographer/bundle-v2", resultUri);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task CreateBuildJob_NormalizesSbomDigest()
{
var store = new TrackingGraphJobStore();
@@ -151,7 +156,8 @@ public sealed class GraphJobServiceTests
Assert.Equal("sha256:" + new string('a', 64), created.SbomDigest);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task CreateBuildJob_RejectsDigestWithoutPrefix()
{
var store = new TrackingGraphJobStore();