Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -25,11 +25,13 @@ public sealed class AlpineConnectorTests
|
||||
_fixture = fixture;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task FetchParseMap_StoresAdvisoriesAndUpdatesCursor()
|
||||
{
|
||||
await using var harness = await BuildHarnessAsync();
|
||||
|
||||
using StellaOps.TestKit;
|
||||
harness.Handler.AddJsonResponse(SecDbUri, BuildMinimalSecDb());
|
||||
|
||||
var connector = harness.ServiceProvider.GetRequiredService<AlpineConnector>();
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace StellaOps.Concelier.Connector.Distro.Alpine.Tests;
|
||||
|
||||
public sealed class AlpineDependencyInjectionRoutineTests
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Register_ConfiguresOptionsAndScheduler()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
@@ -41,6 +42,7 @@ public sealed class AlpineDependencyInjectionRoutineTests
|
||||
|
||||
using var provider = services.BuildServiceProvider(validateScopes: true);
|
||||
|
||||
using StellaOps.TestKit;
|
||||
var options = provider.GetRequiredService<IOptions<AlpineOptions>>().Value;
|
||||
Assert.Equal(new Uri("https://secdb.alpinelinux.org/"), options.BaseUri);
|
||||
Assert.Equal(new[] { "v3.20" }, options.Releases);
|
||||
|
||||
@@ -9,11 +9,13 @@ using StellaOps.Concelier.Models;
|
||||
using StellaOps.Concelier.Storage;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Concelier.Connector.Distro.Alpine.Tests;
|
||||
|
||||
public sealed class AlpineMapperTests
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Map_BuildsApkAdvisoriesWithRanges()
|
||||
{
|
||||
var dto = new AlpineSecDbDto(
|
||||
|
||||
@@ -2,11 +2,13 @@ using System.Linq;
|
||||
using StellaOps.Concelier.Connector.Distro.Alpine.Dto;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Concelier.Connector.Distro.Alpine.Tests;
|
||||
|
||||
public sealed class AlpineSecDbParserTests
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Parse_SecDbFixture_ExtractsPackagesAndMetadata()
|
||||
{
|
||||
var dto = AlpineFixtureReader.LoadDto("v3.20-main.json");
|
||||
|
||||
@@ -10,11 +10,13 @@ using StellaOps.Concelier.Models;
|
||||
using StellaOps.Concelier.Storage;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Concelier.Connector.Distro.Alpine.Tests;
|
||||
|
||||
public sealed class AlpineSnapshotTests
|
||||
{
|
||||
[Theory]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Theory]
|
||||
[InlineData("v3.18-main.json", "alpine-v3.18-main.snapshot.json", "2025-12-22T00:00:00Z")]
|
||||
[InlineData("v3.19-main.json", "alpine-v3.19-main.snapshot.json", "2025-12-22T00:10:00Z")]
|
||||
[InlineData("v3.20-main.json", "alpine-v3.20-main.snapshot.json", "2025-12-22T00:20:00Z")]
|
||||
|
||||
Reference in New Issue
Block a user