Fix build and code structure improvements. New but essential UI functionality. CI improvements. Documentation improvements. AI module improvements.

This commit is contained in:
StellaOps Bot
2025-12-26 21:54:17 +02:00
parent 335ff7da16
commit c2b9cd8d1f
3717 changed files with 264714 additions and 48202 deletions

View File

@@ -15,7 +15,6 @@ using Moq;
using StackExchange.Redis;
using StellaOps.Concelier.Core.Canonical;
using Xunit;
using Xunit.Abstractions;
namespace StellaOps.Concelier.Cache.Valkey.Tests.Performance;

View File

@@ -12,13 +12,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="8.0.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\__Libraries\StellaOps.Concelier.Cache.Valkey\StellaOps.Concelier.Cache.Valkey.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>
</Project>

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
@@ -16,7 +16,6 @@ using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Testing;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Cccs.Tests;
@@ -73,7 +72,6 @@ public sealed class CccsConnectorTests
public async Task Fetch_PersistsRawDocumentWithMetadata()
{
await using var harness = await BuildHarnessAsync();
using StellaOps.TestKit;
SeedFeedResponses(harness.Handler);
var connector = harness.ServiceProvider.GetRequiredService<CccsConnector>();

View File

@@ -6,7 +6,6 @@ using FluentAssertions;
using StellaOps.Concelier.Connector.Cccs.Internal;
using StellaOps.Concelier.Connector.Common.Html;
using Xunit;
using Xunit.Abstractions;
namespace StellaOps.Concelier.Connector.Cccs.Tests.Internal;

View File

@@ -11,7 +11,7 @@
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>
<None Update="Fixtures\*.json">

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
@@ -16,7 +16,6 @@ using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Testing;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.CertBund.Tests;
@@ -83,7 +82,6 @@ public sealed class CertBundConnectorTests
public async Task Fetch_PersistsDocumentWithMetadata()
{
await using var harness = await BuildHarnessAsync();
using StellaOps.TestKit;
SeedResponses(harness.Handler);
var connector = harness.ServiceProvider.GetRequiredService<CertBundConnector>();

View File

@@ -11,7 +11,7 @@
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>
<None Update="Fixtures\*.json">

View File

@@ -19,7 +19,7 @@ using StellaOps.Concelier.Connector.Common.Cursors;
using StellaOps.Concelier.Connector.Common.Testing;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
using Xunit;

View File

@@ -14,7 +14,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Time.Testing;
using StellaOps.Concelier.Documents;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Connector.CertCc;
using StellaOps.Concelier.Connector.CertCc.Configuration;
using StellaOps.Concelier.Connector.Common;

View File

@@ -8,9 +8,10 @@
<ItemGroup>
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.CertCc/StellaOps.Concelier.Connector.CertCc.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>
<None Update="Fixtures\*.json">

View File

@@ -24,7 +24,7 @@ using StellaOps.Concelier.Connector.Common.Http;
using StellaOps.Concelier.Connector.Common.Testing;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Testing;

View File

@@ -9,6 +9,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.CertIn/StellaOps.Concelier.Connector.CertIn.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="CertIn/Fixtures/**" CopyToOutputDirectory="Always" />

View File

@@ -33,7 +33,7 @@ public sealed class SourceStateSeedProcessorTests : IAsyncLifetime
_database = _client.GetDatabase($"source-state-seed-{Guid.NewGuid():N}");
_documentStore = new DocumentStore(_database, NullLogger<DocumentStore>.Instance);
_rawStorage = new RawDocumentStorage();
_stateRepository = new InMemorySourceStateRepository(_database, NullLogger<InMemorySourceStateRepository>.Instance);
_stateRepository = new InMemorySourceStateRepository();
_timeProvider = new FakeTimeProvider(new DateTimeOffset(2025, 10, 28, 12, 0, 0, TimeSpan.Zero));
_hash = CryptoHashFactory.CreateDefault();
}

View File

@@ -4,20 +4,20 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseConcelierTestInfra>false</UseConcelierTestInfra>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" Version="9.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />
<PackageReference Include="NSubstitute" />
<PackageReference Include="xunit.runner.visualstudio" >
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.Cryptography/StellaOps.Cryptography.csproj" />
</ItemGroup>
</Project>
</Project>

View File

@@ -19,7 +19,6 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using Xunit.Abstractions;
namespace StellaOps.Concelier.Connector.Cve.Tests;

View File

@@ -144,9 +144,9 @@ public sealed class CveParserSnapshotTests
// Assert
dto.Metrics.Should().HaveCount(1);
dto.Metrics[0].CvssV31.Should().NotBeNull();
dto.Metrics[0].CvssV31!.BaseScore.Should().Be(9.8);
dto.Metrics[0].CvssV31.BaseSeverity.Should().Be("CRITICAL");
dto.Metrics[0].Version.Should().Be("3.1");
dto.Metrics[0].BaseScore.Should().Be(9.8);
dto.Metrics[0].BaseSeverity.Should().Be("CRITICAL");
}
[Fact]

View File

@@ -13,7 +13,7 @@
<ProjectReference Include="../../../__Libraries/StellaOps.Canonical.Json/StellaOps.Canonical.Json.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>
<None Include="Fixtures/*.json" CopyToOutputDirectory="Always" />

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -12,7 +12,6 @@ using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Testing;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Distro.Alpine.Tests;
@@ -33,7 +32,6 @@ public sealed class AlpineConnectorTests
{
await using var harness = await BuildHarnessAsync();
using StellaOps.TestKit;
harness.Handler.AddJsonResponse(SecDbUri, BuildMinimalSecDb());
var connector = harness.ServiceProvider.GetRequiredService<AlpineConnector>();

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
@@ -44,7 +44,6 @@ 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);

View File

@@ -18,4 +18,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
</Project>

View File

@@ -14,7 +14,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Time.Testing;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Models;
using StellaOps.Concelier.Connector.Common;
using StellaOps.Concelier.Connector.Common.Http;
@@ -26,8 +26,6 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Testing;
using Xunit;
using Xunit.Abstractions;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Distro.Debian.Tests;
@@ -73,7 +71,6 @@ public sealed class DebianConnectorTests : IAsyncLifetime
{
await using var provider = await BuildServiceProviderAsync();
using StellaOps.TestKit;
SeedInitialResponses();
var connector = provider.GetRequiredService<DebianConnector>();

View File

@@ -10,5 +10,6 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Distro.Debian/StellaOps.Concelier.Connector.Distro.Debian.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
</Project>

View File

@@ -27,11 +27,10 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
using StellaOps.Plugin;
using Xunit;
using Xunit.Abstractions;
namespace StellaOps.Concelier.Connector.Distro.RedHat.Tests;

View File

@@ -9,6 +9,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Distro.RedHat/StellaOps.Concelier.Connector.Distro.RedHat.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="RedHat/Fixtures/*.json" CopyToOutputDirectory="Always" TargetPath="Source/Distro/RedHat/Fixtures/%(Filename)%(Extension)" />

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using System.Net;
@@ -17,8 +17,6 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Testing;
using Xunit;
using Xunit.Abstractions;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Distro.Suse.Tests;
@@ -43,7 +41,6 @@ public sealed class SuseConnectorTests
{
await using var harness = await BuildHarnessAsync();
using StellaOps.TestKit;
SeedInitialResponses(harness.Handler);
var connector = harness.ServiceProvider.GetRequiredService<SuseConnector>();

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using System.Net;
@@ -19,7 +19,6 @@ using StellaOps.Concelier.Testing;
using StellaOps.Cryptography.DependencyInjection;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Distro.Ubuntu.Tests;
@@ -42,7 +41,6 @@ public sealed class UbuntuConnectorTests
{
await using var harness = await BuildHarnessAsync();
using StellaOps.TestKit;
SeedInitialResponses(harness.Handler);
var connector = harness.ServiceProvider.GetRequiredService<UbuntuConnector>();

View File

@@ -17,6 +17,7 @@ using StellaOps.Concelier.Documents;
using StellaOps.Concelier.Storage;
using StellaOps.Cryptography;
using StellaOps.Scanner.Storage.Epss;
using StellaOps.TestKit;
using Xunit;
namespace StellaOps.Concelier.Connector.Epss.Tests;
@@ -94,7 +95,7 @@ public sealed class EpssConnectorTests
await documentStore.UpsertAsync(existing, CancellationToken.None);
await stateRepository.UpdateCursorAsync(
EpssConnectorPlugin.SourceName,
EpssCursor.Empty with { ETag = "\"epss-etag\"" }.ToDocumentObject(),
(EpssCursor.Empty with { ETag = "\"epss-etag\"" }).ToDocumentObject(),
DateTimeOffset.UtcNow,
CancellationToken.None);
@@ -130,7 +131,7 @@ public sealed class EpssConnectorTests
var recordId = Guid.NewGuid();
var rawStorage = new RawDocumentStorage(documentStore);
await rawStorage.UploadAsync(EpssConnectorPlugin.SourceName, uri.ToString(), payload, "application/gzip", CancellationToken.None, recordId);
await rawStorage.UploadAsync(EpssConnectorPlugin.SourceName, uri.ToString(), payload, "application/gzip", null, CancellationToken.None, recordId);
var document = new DocumentRecord(
recordId,
@@ -151,7 +152,7 @@ public sealed class EpssConnectorTests
await documentStore.UpsertAsync(document, CancellationToken.None);
await stateRepository.UpdateCursorAsync(
EpssConnectorPlugin.SourceName,
EpssCursor.Empty with { PendingDocuments = new[] { recordId } }.ToDocumentObject(),
(EpssCursor.Empty with { PendingDocuments = new[] { recordId } }).ToDocumentObject(),
DateTimeOffset.UtcNow,
CancellationToken.None);
@@ -182,7 +183,7 @@ public sealed class EpssConnectorTests
var recordId = Guid.NewGuid();
var rawStorage = new RawDocumentStorage(documentStore);
await rawStorage.UploadAsync(EpssConnectorPlugin.SourceName, uri.ToString(), payload, "application/gzip", CancellationToken.None, recordId);
await rawStorage.UploadAsync(EpssConnectorPlugin.SourceName, uri.ToString(), payload, "application/gzip", null, CancellationToken.None, recordId);
var document = new DocumentRecord(
recordId,
@@ -220,7 +221,7 @@ public sealed class EpssConnectorTests
await stateRepository.UpdateCursorAsync(
EpssConnectorPlugin.SourceName,
EpssCursor.Empty with { PendingMappings = new[] { recordId } }.ToDocumentObject(),
(EpssCursor.Empty with { PendingMappings = new[] { recordId } }).ToDocumentObject(),
DateTimeOffset.UtcNow,
CancellationToken.None);
@@ -337,7 +338,6 @@ public sealed class EpssConnectorTests
foreach (var line in lines)
{
writer.WriteLine(line);
using StellaOps.TestKit;
}
}

View File

@@ -10,7 +10,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Epss/StellaOps.Concelier.Connector.Epss.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Cryptography/StellaOps.Cryptography.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.Cryptography/StellaOps.Cryptography.csproj" />
<ProjectReference Include="../../../Scanner/__Libraries/StellaOps.Scanner.Storage/StellaOps.Scanner.Storage.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
@@ -18,4 +18,4 @@
<None Include="Epss/Fixtures/*.csv" CopyToOutputDirectory="Always" />
<None Include="Expected/*.json" CopyToOutputDirectory="Always" />
</ItemGroup>
</Project>
</Project>

View File

@@ -14,7 +14,7 @@
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>
<None Include="Fixtures/*.json" CopyToOutputDirectory="Always" />

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using System.Net;
@@ -15,7 +15,6 @@ using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Testing;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Ics.Cisa.Tests;
@@ -34,7 +33,6 @@ public sealed class IcsCisaConnectorTests
public async Task FetchParseMap_EndToEnd_ProducesCanonicalAdvisories()
{
await using var harness = await BuildHarnessAsync();
using StellaOps.TestKit;
RegisterResponses(harness.Handler);
var connector = harness.ServiceProvider.GetRequiredService<IcsCisaConnector>();

View File

@@ -23,7 +23,7 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
namespace StellaOps.Concelier.Connector.Ics.Kaspersky.Tests;

View File

@@ -9,6 +9,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Ics.Kaspersky/StellaOps.Concelier.Connector.Ics.Kaspersky.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Kaspersky/Fixtures/**" CopyToOutputDirectory="Always" />

View File

@@ -23,8 +23,7 @@ using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.JpFlags;
using StellaOps.Concelier.Storage.Postgres;
using Xunit.Abstractions;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
namespace StellaOps.Concelier.Connector.Jvn.Tests;

View File

@@ -9,6 +9,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Jvn/StellaOps.Concelier.Connector.Jvn.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Jvn/Fixtures/**" CopyToOutputDirectory="Always" />

View File

@@ -16,7 +16,7 @@ using StellaOps.Concelier.Connector.Kev;
using StellaOps.Concelier.Connector.Kev.Configuration;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
using Xunit;

View File

@@ -12,9 +12,10 @@
<ProjectReference Include="../../../__Tests/__Libraries/StellaOps.Concelier.Testing/StellaOps.Concelier.Testing.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Kev/StellaOps.Concelier.Connector.Kev.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.Canonical.Json/StellaOps.Canonical.Json.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>

View File

@@ -25,11 +25,9 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
using Xunit;
using Xunit.Abstractions;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Kisa.Tests;
@@ -351,7 +349,6 @@ public sealed class KisaConnectorTests : IAsyncLifetime
using var metrics = new KisaMetricCollector();
using StellaOps.TestKit;
var connector = provider.GetRequiredService<KisaConnector>();
await connector.FetchAsync(provider, CancellationToken.None);
await connector.ParseAsync(provider, CancellationToken.None);

View File

@@ -11,10 +11,10 @@
<ProjectReference Include="../StellaOps.Concelier.Connector.Common.Tests/StellaOps.Concelier.Connector.Common.Tests.csproj" />
<ProjectReference Include="../../../__Tests/__Libraries/StellaOps.Concelier.Testing/StellaOps.Concelier.Testing.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>
<None Update="Fixtures/*.json">
@@ -27,4 +27,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
</Project>

View File

@@ -25,7 +25,7 @@ using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.ChangeHistory;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
namespace StellaOps.Concelier.Connector.Nvd.Tests;

View File

@@ -40,7 +40,7 @@ public sealed class NvdParserSnapshotTests : ConnectorParserTestBase<JsonDocumen
}
protected override IReadOnlyList<Advisory> DeserializeNormalized(string json) =>
CanonJson.Deserialize<List<Advisory>>(json) ?? new List<Advisory>();
JsonSerializer.Deserialize<List<Advisory>>(json) ?? new List<Advisory>();
protected override string SerializeToCanonical(IReadOnlyList<Advisory> model)
{

View File

@@ -12,9 +12,10 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Nvd/StellaOps.Concelier.Connector.Nvd.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.Canonical.Json/StellaOps.Canonical.Json.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>
<None Include="Nvd/Fixtures/*.json" CopyToOutputDirectory="Always" />

View File

@@ -10,7 +10,6 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Connector.Common;
using Xunit;
using Xunit.Abstractions;
namespace StellaOps.Concelier.Connector.Osv.Tests;

View File

@@ -28,7 +28,6 @@ using StellaOps.Cryptography.DependencyInjection;
using Xunit;
using Xunit.Sdk;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Ru.Bdu.Tests;
@@ -264,7 +263,6 @@ public sealed class RuBduConnectorSnapshotTests : IAsyncLifetime
entry.LastWriteTime = new DateTimeOffset(2025, 10, 14, 9, 0, 0, TimeSpan.Zero);
using var entryStream = entry.Open();
using var writer = new StreamWriter(entryStream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
using StellaOps.TestKit;
writer.Write(xml);
}

View File

@@ -13,4 +13,4 @@
<ProjectReference Include="../../../__Libraries/StellaOps.Cryptography.DependencyInjection/StellaOps.Cryptography.DependencyInjection.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>
</Project>

View File

@@ -24,11 +24,10 @@ using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Testing;
using StellaOps.Concelier.Models;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Cryptography.DependencyInjection;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Ru.Nkcki.Tests;
@@ -88,7 +87,6 @@ public sealed class RuNkckiConnectorTests : IAsyncLifetime
public async Task Fetch_ReusesCachedBulletinWhenListingFails()
{
await using var provider = await BuildServiceProviderAsync();
using StellaOps.TestKit;
SeedListingAndBulletin();
var connector = provider.GetRequiredService<RuNkckiConnector>();

View File

@@ -1,4 +1,4 @@
using System.Text.Json;
using System.Text.Json;
using StellaOps.Concelier.Connector.Ru.Nkcki.Internal;
using Xunit;
@@ -17,7 +17,7 @@ public sealed class RuNkckiJsonParserTests
"vuln_id": {"MITRE": "CVE-2025-0001", "FSTEC": "BDU:2025-00001"},
"date_published": "2025-09-01",
"date_updated": "2025-09-02",
"cvss_rating": "КРИТИЧЕСКИЙ",
"cvss_rating": "КРИТИЧЕСКИЙ",
"patch_available": true,
"description": "Test description",
"cwe": {"cwe_number": 79, "cwe_description": "Cross-site scripting"},
@@ -43,7 +43,6 @@ public sealed class RuNkckiJsonParserTests
""";
using var document = JsonDocument.Parse(json);
using StellaOps.TestKit;
var dto = RuNkckiJsonParser.Parse(document.RootElement);
Assert.Equal("BDU:2025-00001", dto.FstecId);

View File

@@ -12,5 +12,6 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Ru.Nkcki/StellaOps.Concelier.Connector.Ru.Nkcki.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.Cryptography.DependencyInjection/StellaOps.Cryptography.DependencyInjection.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
</Project>
</Project>

View File

@@ -145,7 +145,6 @@ public sealed class MirrorSignatureVerifierTests
private static string WritePublicKeyPem(CryptoSigningKey signingKey)
{
using var ecdsa = ECDsa.Create(signingKey.PublicParameters);
using StellaOps.TestKit;
var info = ecdsa.ExportSubjectPublicKeyInfo();
var pem = PemEncoding.Write("PUBLIC KEY", info);
var path = Path.Combine(Path.GetTempPath(), $"stellaops-mirror-{Guid.NewGuid():N}.pem");

View File

@@ -10,8 +10,9 @@
<ProjectReference Include="../../../__Libraries/StellaOps.Cryptography/StellaOps.Cryptography.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.Cryptography.DependencyInjection/StellaOps.Cryptography.DependencyInjection.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Fixtures\**\*.json" CopyToOutputDirectory="Always" />
</ItemGroup>
</Project>
</Project>

View File

@@ -22,7 +22,7 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
using StellaOps.Cryptography;
using StellaOps.Cryptography.DependencyInjection;
@@ -427,7 +427,6 @@ public sealed class StellaOpsMirrorConnectorTests : IAsyncLifetime
ArgumentNullException.ThrowIfNull(signingKey);
var path = Path.Combine(Path.GetTempPath(), $"stellaops-mirror-{Guid.NewGuid():N}.pem");
using var ecdsa = ECDsa.Create(signingKey.PublicParameters);
using StellaOps.TestKit;
var publicKeyInfo = ecdsa.ExportSubjectPublicKeyInfo();
var pem = PemEncoding.Write("PUBLIC KEY", publicKeyInfo);
File.WriteAllText(path, pem);

View File

@@ -26,7 +26,7 @@ using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.PsirtFlags;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
namespace StellaOps.Concelier.Connector.Vndr.Adobe.Tests;
@@ -259,7 +259,6 @@ public sealed class AdobeConnectorFetchTests : IAsyncLifetime
Assert.Equal(normalizedExpected, normalizedSnapshot);
var psirtStore = provider.GetRequiredService<IPsirtFlagStore>();
var flagRecord = await psirtStore.FindAsync("APSB25-87", CancellationToken.None);
Assert.NotNull(flagRecord);
Assert.Equal("Adobe", flagRecord!.Vendor);

View File

@@ -9,6 +9,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Vndr.Adobe/StellaOps.Concelier.Connector.Vndr.Adobe.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Adobe/Fixtures/*.html" CopyToOutputDirectory="Always" TargetPath="Source/Vndr/Adobe/Fixtures/%(Filename)%(Extension)" />

View File

@@ -18,7 +18,7 @@ using StellaOps.Concelier.Connector.Vndr.Apple;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage.PsirtFlags;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
using Xunit;

View File

@@ -10,6 +10,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Vndr.Apple/StellaOps.Concelier.Connector.Vndr.Apple.csproj" />
<ProjectReference Include="../../../__Tests/__Libraries/StellaOps.Concelier.Testing/StellaOps.Concelier.Testing.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Apple/Fixtures/*.html" CopyToOutputDirectory="Always" TargetPath="Source/Vndr/Apple/Fixtures/%(Filename)%(Extension)" />

View File

@@ -9,7 +9,7 @@ using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Time.Testing;
using StellaOps.Concelier.Documents;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Models;
using StellaOps.Concelier.Connector.Common.Http;
using StellaOps.Concelier.Connector.Common.Json;

View File

@@ -9,6 +9,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Vndr.Chromium/StellaOps.Concelier.Connector.Vndr.Chromium.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Chromium/Fixtures/*.html" CopyToOutputDirectory="Always" />

View File

@@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>

View File

@@ -20,12 +20,11 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Testing;
using Xunit;
using StellaOps.Concelier.Connector.Common.Http;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Connector.Vndr.Msrc.Tests;
@@ -50,7 +49,6 @@ public sealed class MsrcConnectorTests : IAsyncLifetime
public async Task FetchParseMap_ProducesCanonicalAdvisory()
{
await using var provider = await BuildServiceProviderAsync();
using StellaOps.TestKit;
SeedResponses();
var connector = provider.GetRequiredService<MsrcConnector>();

View File

@@ -11,10 +11,11 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../../__Tests/__Libraries/StellaOps.Concelier.Testing/StellaOps.Concelier.Testing.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>

View File

@@ -26,10 +26,9 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Storage.PsirtFlags;
using StellaOps.Concelier.Testing;
using Xunit.Abstractions;
namespace StellaOps.Concelier.Connector.Vndr.Oracle.Tests;

View File

@@ -9,6 +9,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Vndr.Oracle/StellaOps.Concelier.Connector.Vndr.Oracle.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Oracle/Fixtures/**/*.json" CopyToOutputDirectory="Always" />

View File

@@ -9,6 +9,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Connector.Vndr.Vmware/StellaOps.Concelier.Connector.Vndr.Vmware.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Vmware/Fixtures/*.json">

View File

@@ -25,10 +25,9 @@ using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Storage.PsirtFlags;
using StellaOps.Concelier.Testing;
using Xunit.Abstractions;
namespace StellaOps.Concelier.Connector.Vndr.Vmware.Tests.Vmware;
@@ -126,10 +125,18 @@ public sealed class VmwareConnectorTests : IAsyncLifetime
Assert.Equal(3, advisories.Count);
Assert.Contains(advisories, advisory => advisory.AdvisoryKey == "VMSA-2024-0003");
psirtFlags = await psirtCollection.Find(Builders<DocumentObject>.Filter.Empty).ToListAsync();
_output.WriteLine("PSIRT flags after resume: " + string.Join(", ", psirtFlags.Select(flag => flag.GetValue("_id", DocumentValue.Create("<missing>")).ToString())));
psirtFlags.Clear();
foreach (var advisory in advisories)
{
var flag = await psirtStore.FindAsync(advisory.AdvisoryKey, CancellationToken.None);
if (flag is not null)
{
psirtFlags.Add(flag);
}
}
_output.WriteLine("PSIRT flags after resume: " + string.Join(", ", psirtFlags.Select(flag => flag.AdvisoryKey)));
Assert.Equal(3, psirtFlags.Count);
Assert.Contains(psirtFlags, doc => doc["_id"] == "VMSA-2024-0003");
Assert.Contains(psirtFlags, flag => flag.AdvisoryKey == "VMSA-2024-0003");
var measurements = metrics.Measurements;
_output.WriteLine("Captured metrics:");

View File

@@ -458,6 +458,12 @@ public sealed class CanonicalDeduplicationTests
return Task.FromResult((long)_canonicals.Count);
}
public Task<IReadOnlyList<ProvenanceScopeDto>> GetProvenanceScopesAsync(Guid canonicalId, CancellationToken ct = default)
{
// Return empty list for test purposes - provenance scopes are not tested in deduplication tests
return Task.FromResult<IReadOnlyList<ProvenanceScopeDto>>([]);
}
private string GetSourceName(Guid sourceId)
{
return _sourceIds.FirstOrDefault(kvp => kvp.Value == sourceId).Key ?? "unknown";

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
@@ -270,7 +270,6 @@ public sealed class JobCoordinatorTests
jobOptions.Definitions.Add(definition.Kind, definition);
using var diagnostics = new JobDiagnostics();
using StellaOps.TestKit;
var coordinator = new JobCoordinator(
Options.Create(jobOptions),
jobStore,

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Extensions.Configuration;
@@ -51,7 +51,6 @@ public sealed class JobPluginRegistrationExtensionsTests
descriptor => descriptor.ServiceType.FullName == typeof(PluginRoutineExecuted).FullName);
using var provider = services.BuildServiceProvider();
using StellaOps.TestKit;
var schedulerOptions = provider.GetRequiredService<IOptions<JobSchedulerOptions>>().Value;
Assert.True(schedulerOptions.Definitions.TryGetValue(PluginJob.JobKind, out var definition));

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Core.Jobs;
@@ -49,7 +49,6 @@ public sealed class JobSchedulerBuilderTests
builder.AddJob<DefaultedJob>(kind: "jobs:defaults");
using var provider = services.BuildServiceProvider();
using StellaOps.TestKit;
var options = provider.GetRequiredService<IOptions<JobSchedulerOptions>>().Value;
Assert.True(options.Definitions.TryGetValue("jobs:defaults", out var definition));

View File

@@ -45,7 +45,7 @@ public sealed class SchemaManifestTests
var snapshot = doc.RootElement.GetProperty("snapshot");
var staleness = snapshot.GetProperty("stalenessHours").GetInt32();
staleness.Should().BeLessOrEqualTo(168, "offline bundles must cap snapshot staleness to 7 days");
staleness.Should().BeLessThanOrEqualTo(168, "offline bundles must cap snapshot staleness to 7 days");
var manifest = doc.RootElement.GetProperty("manifest").EnumerateArray().ToArray();
manifest.Should().NotBeEmpty();

View File

@@ -7,15 +7,17 @@
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Core/StellaOps.Concelier.Core.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.RawModels/StellaOps.Concelier.RawModels.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.Ingestion.Telemetry/StellaOps.Ingestion.Telemetry.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
<ProjectReference Include="../../../Aoc/__Libraries/StellaOps.Aoc/StellaOps.Aoc.csproj" />
<!-- Test packages inherited from Directory.Build.props -->
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
<PackageReference Include="Moq" Version="4.20.72" />
</ItemGroup>
</Project>
</Project>

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Collections.Immutable;
@@ -44,7 +44,6 @@ public sealed class JsonExporterDependencyInjectionRoutineTests
routine.Register(services, configuration);
using var provider = services.BuildServiceProvider();
using StellaOps.TestKit;
var optionsAccessor = provider.GetRequiredService<IOptions<JobSchedulerOptions>>();
var options = optionsAccessor.Value;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Globalization;
@@ -433,7 +433,6 @@ public sealed class JsonFeedExporterTests : IDisposable
private static string WriteSigningKey(string directory)
{
using var ecdsa = ECDsa.Create(ECCurve.NamedCurves.nistP256);
using StellaOps.TestKit;
var pkcs8 = ecdsa.ExportPkcs8PrivateKey();
var pem = BuildPem("PRIVATE KEY", pkcs8);
var path = Path.Combine(directory, $"mirror-key-{Guid.NewGuid():N}.pem");

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -1198,7 +1198,6 @@ public sealed class TrivyDbFeedExporterTests : IDisposable
var archivePath = Path.Combine(workingDirectory, "db.tar.gz");
File.WriteAllBytes(archivePath, _payload);
using var sha256 = SHA256.Create();
using StellaOps.TestKit;
var digest = "sha256:" + Convert.ToHexString(sha256.ComputeHash(_payload)).ToLowerInvariant();
return Task.FromResult(new TrivyDbBuilderResult(

View File

@@ -10,11 +10,11 @@
<ItemGroup>
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Federation/StellaOps.Concelier.Federation.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Models/StellaOps.Concelier.Models.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Storage.Postgres/StellaOps.Concelier.Storage.Postgres.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Concelier.Persistence/StellaOps.Concelier.Persistence.csproj" />
<!-- Test packages inherited from Directory.Build.props -->
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Options" />
<PackageReference Include="Moq" />
</ItemGroup>
</Project>
</Project>

View File

@@ -10,11 +10,11 @@
<ProjectReference Include="..\..\__Libraries\StellaOps.Concelier.Normalization\StellaOps.Concelier.Normalization.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Testcontainers" Version="4.4.0" />
<PackageReference Include="Testcontainers" />
</ItemGroup>
<ItemGroup>
<None Update="Fixtures\**\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
</Project>

View File

@@ -2,29 +2,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<UseXunitV3>true</UseXunitV3>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<OutputType>Exe</OutputType>
<RootNamespace>StellaOps.Concelier.Interest.Tests</RootNamespace>
<!-- Unit tests use mocks, no need for Postgres test infrastructure -->
<UseConcelierTestInfra>false</UseConcelierTestInfra>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="FluentAssertions" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
<PackageReference Include="xunit.v3" />
</ItemGroup> <ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\__Libraries\StellaOps.Concelier.Interest\StellaOps.Concelier.Interest.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>
</Project>

View File

@@ -7,13 +7,14 @@ using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Merge.Analyzers.Tests;
public sealed class MergeUsageAnalyzerTests
{
[Trait("Category", TestCategories.Unit)]
[Fact]
[Fact]
public async Task ReportsDiagnostic_ForAdvisoryMergeServiceInstantiation()
{
const string source = """
@@ -35,7 +36,7 @@ public sealed class MergeUsageAnalyzerTests
}
[Trait("Category", TestCategories.Unit)]
[Fact]
[Fact]
public async Task ReportsDiagnostic_ForAddMergeModuleInvocation()
{
const string source = """
@@ -59,7 +60,7 @@ public sealed class MergeUsageAnalyzerTests
}
[Trait("Category", TestCategories.Unit)]
[Fact]
[Fact]
public async Task ReportsDiagnostic_ForFieldDeclaration()
{
const string source = """
@@ -78,7 +79,7 @@ public sealed class MergeUsageAnalyzerTests
}
[Trait("Category", TestCategories.Unit)]
[Fact]
[Fact]
public async Task DoesNotReportDiagnostic_InsideMergeAssembly()
{
const string source = """
@@ -97,14 +98,13 @@ public sealed class MergeUsageAnalyzerTests
}
[Trait("Category", TestCategories.Unit)]
[Fact]
[Fact]
public async Task ReportsDiagnostic_ForTypeOfUsage()
{
const string source = """
using System;
using StellaOps.Concelier.Merge.Services;
using StellaOps.TestKit;
namespace Sample.TypeOf;
public static class Demo

View File

@@ -8,20 +8,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\\..\\__Analyzers\\StellaOps.Concelier.Merge.Analyzers\\StellaOps.Concelier.Merge.Analyzers.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>
</Project>

View File

@@ -1,3 +1,5 @@
#pragma warning disable CONCELIER0001 // AdvisoryMergeService is deprecated - tests verify existing behavior during Link-Not-Merge transition
using System.Collections.Concurrent;
using System.Collections.Immutable;
using System.Linq;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
@@ -498,7 +498,6 @@ public sealed class AdvisoryPrecedenceMergerTests
var logger = new TestLogger<AdvisoryPrecedenceMerger>();
using var metrics = new MetricCollector("StellaOps.Concelier.Merge");
using StellaOps.TestKit;
var merger = new AdvisoryPrecedenceMerger(
new AffectedPackagePrecedenceResolver(),
options,

View File

@@ -92,9 +92,9 @@ public sealed class MergeExportSnapshotTests
var titleIndex = canonicalJson.IndexOf("\"title\"", StringComparison.Ordinal);
var severityIndex = canonicalJson.IndexOf("\"severity\"", StringComparison.Ordinal);
advisoryKeyIndex.Should().BeGreaterOrEqualTo(0);
titleIndex.Should().BeGreaterOrEqualTo(0);
severityIndex.Should().BeGreaterOrEqualTo(0);
advisoryKeyIndex.Should().BeGreaterThanOrEqualTo(0);
titleIndex.Should().BeGreaterThanOrEqualTo(0);
severityIndex.Should().BeGreaterThanOrEqualTo(0);
}
[Fact]

View File

@@ -15,12 +15,12 @@
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<None Update="Fixtures\Golden\**\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
</Project>

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
@@ -130,7 +130,6 @@ public sealed class CanonicalJsonSerializerTests
var json = CanonicalJsonSerializer.Serialize(advisory);
using var document = JsonDocument.Parse(json);
using StellaOps.TestKit;
var rangeElement = document.RootElement
.GetProperty("affectedPackages")[0]
.GetProperty("versionRanges")[0];

View File

@@ -0,0 +1,128 @@
{
"advisoryKey": "GHSA-aaaa-bbbb-cccc",
"affectedPackages": [
{
"type": "semver",
"identifier": "pkg:npm/example-widget",
"platform": null,
"versionRanges": [
{
"fixedVersion": "2.5.1",
"introducedVersion": null,
"lastAffectedVersion": null,
"primitives": null,
"provenance": {
"source": "ghsa",
"kind": "map",
"value": "ghsa-aaaa-bbbb-cccc",
"decisionReason": null,
"recordedAt": "2024-03-05T10:00:00+00:00",
"fieldMask": []
},
"rangeExpression": ">=0.0.0 <2.5.1",
"rangeKind": "semver"
},
{
"fixedVersion": "3.2.4",
"introducedVersion": "3.0.0",
"lastAffectedVersion": null,
"primitives": null,
"provenance": {
"source": "ghsa",
"kind": "map",
"value": "ghsa-aaaa-bbbb-cccc",
"decisionReason": null,
"recordedAt": "2024-03-05T10:00:00+00:00",
"fieldMask": []
},
"rangeExpression": null,
"rangeKind": "semver"
}
],
"normalizedVersions": [],
"statuses": [],
"provenance": [
{
"source": "ghsa",
"kind": "map",
"value": "ghsa-aaaa-bbbb-cccc",
"decisionReason": null,
"recordedAt": "2024-03-05T10:00:00+00:00",
"fieldMask": []
}
]
}
],
"aliases": [
"CVE-2024-2222",
"GHSA-aaaa-bbbb-cccc"
],
"canonicalMetricId": null,
"credits": [],
"cvssMetrics": [
{
"baseScore": 8.8,
"baseSeverity": "high",
"provenance": {
"source": "ghsa",
"kind": "map",
"value": "ghsa-aaaa-bbbb-cccc",
"decisionReason": null,
"recordedAt": "2024-03-05T10:00:00+00:00",
"fieldMask": []
},
"vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"version": "3.1"
}
],
"cwes": [],
"description": null,
"exploitKnown": false,
"language": "en",
"mergeHash": null,
"modified": "2024-03-04T12:00:00+00:00",
"provenance": [
{
"source": "ghsa",
"kind": "map",
"value": "ghsa-aaaa-bbbb-cccc",
"decisionReason": null,
"recordedAt": "2024-03-05T10:00:00+00:00",
"fieldMask": []
}
],
"published": "2024-03-04T00:00:00+00:00",
"references": [
{
"kind": "patch",
"provenance": {
"source": "ghsa",
"kind": "map",
"value": "ghsa-aaaa-bbbb-cccc",
"decisionReason": null,
"recordedAt": "2024-03-05T10:00:00+00:00",
"fieldMask": []
},
"sourceTag": "ghsa",
"summary": "Patch commit",
"url": "https://github.com/example/widget/commit/abcd1234"
},
{
"kind": "advisory",
"provenance": {
"source": "ghsa",
"kind": "map",
"value": "ghsa-aaaa-bbbb-cccc",
"decisionReason": null,
"recordedAt": "2024-03-05T10:00:00+00:00",
"fieldMask": []
},
"sourceTag": "ghsa",
"summary": "GitHub Security Advisory",
"url": "https://github.com/example/widget/security/advisories/GHSA-aaaa-bbbb-cccc"
}
],
"severity": "high",
"summary": "A crafted payload can pollute Object.prototype leading to RCE.",
"title": "Prototype pollution in widget.js"
}

View File

@@ -0,0 +1,46 @@
{
"advisoryKey": "CVE-2023-9999",
"affectedPackages": [],
"aliases": [
"CVE-2023-9999"
],
"canonicalMetricId": null,
"credits": [],
"cvssMetrics": [],
"cwes": [],
"description": null,
"exploitKnown": true,
"language": "en",
"mergeHash": null,
"modified": "2024-02-09T16:22:00+00:00",
"provenance": [
{
"source": "cisa-kev",
"kind": "annotate",
"value": "kev",
"decisionReason": null,
"recordedAt": "2024-02-10T09:30:00+00:00",
"fieldMask": []
}
],
"published": "2023-11-20T00:00:00+00:00",
"references": [
{
"kind": "kev",
"provenance": {
"source": "cisa-kev",
"kind": "annotate",
"value": "kev",
"decisionReason": null,
"recordedAt": "2024-02-10T09:30:00+00:00",
"fieldMask": []
},
"sourceTag": "cisa",
"summary": "CISA KEV entry",
"url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog"
}
],
"severity": "critical",
"summary": "Unauthenticated RCE due to unsafe deserialization.",
"title": "Remote code execution in LegacyServer"
}

View File

@@ -0,0 +1,123 @@
{
"advisoryKey": "CVE-2024-1234",
"affectedPackages": [
{
"type": "cpe",
"identifier": "cpe:/a:examplecms:examplecms:1.0",
"platform": null,
"versionRanges": [
{
"fixedVersion": "1.0.5",
"introducedVersion": "1.0",
"lastAffectedVersion": null,
"primitives": null,
"provenance": {
"source": "nvd",
"kind": "map",
"value": "cve-2024-1234",
"decisionReason": null,
"recordedAt": "2024-08-01T12:00:00+00:00",
"fieldMask": []
},
"rangeExpression": null,
"rangeKind": "version"
}
],
"normalizedVersions": [],
"statuses": [
{
"provenance": {
"source": "nvd",
"kind": "map",
"value": "cve-2024-1234",
"decisionReason": null,
"recordedAt": "2024-08-01T12:00:00+00:00",
"fieldMask": []
},
"status": "affected"
}
],
"provenance": [
{
"source": "nvd",
"kind": "map",
"value": "cve-2024-1234",
"decisionReason": null,
"recordedAt": "2024-08-01T12:00:00+00:00",
"fieldMask": []
}
]
}
],
"aliases": [
"CVE-2024-1234"
],
"canonicalMetricId": null,
"credits": [],
"cvssMetrics": [
{
"baseScore": 9.8,
"baseSeverity": "critical",
"provenance": {
"source": "nvd",
"kind": "map",
"value": "cve-2024-1234",
"decisionReason": null,
"recordedAt": "2024-08-01T12:00:00+00:00",
"fieldMask": []
},
"vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"version": "3.1"
}
],
"cwes": [],
"description": null,
"exploitKnown": false,
"language": "en",
"mergeHash": null,
"modified": "2024-07-16T10:35:00+00:00",
"provenance": [
{
"source": "nvd",
"kind": "map",
"value": "cve-2024-1234",
"decisionReason": null,
"recordedAt": "2024-08-01T12:00:00+00:00",
"fieldMask": []
}
],
"published": "2024-07-15T00:00:00+00:00",
"references": [
{
"kind": "advisory",
"provenance": {
"source": "example",
"kind": "fetch",
"value": "bulletin",
"decisionReason": null,
"recordedAt": "2024-07-14T15:00:00+00:00",
"fieldMask": []
},
"sourceTag": "vendor",
"summary": "Vendor bulletin",
"url": "https://example.org/security/CVE-2024-1234"
},
{
"kind": "advisory",
"provenance": {
"source": "nvd",
"kind": "map",
"value": "cve-2024-1234",
"decisionReason": null,
"recordedAt": "2024-08-01T12:00:00+00:00",
"fieldMask": []
},
"sourceTag": "nvd",
"summary": "NVD entry",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-1234"
}
],
"severity": "high",
"summary": "An integer overflow in ExampleCMS allows remote attackers to escalate privileges.",
"title": "Integer overflow in ExampleCMS"
}

View File

@@ -0,0 +1,126 @@
{
"advisoryKey": "RHSA-2024:0252",
"affectedPackages": [
{
"type": "rpm",
"identifier": "kernel-0:4.18.0-553.el8.x86_64",
"platform": "rhel-8",
"versionRanges": [
{
"fixedVersion": null,
"introducedVersion": "0:4.18.0-553.el8",
"lastAffectedVersion": null,
"primitives": null,
"provenance": {
"source": "redhat",
"kind": "map",
"value": "rhsa-2024:0252",
"decisionReason": null,
"recordedAt": "2024-05-11T09:00:00+00:00",
"fieldMask": []
},
"rangeExpression": null,
"rangeKind": "nevra"
}
],
"normalizedVersions": [],
"statuses": [
{
"provenance": {
"source": "redhat",
"kind": "map",
"value": "rhsa-2024:0252",
"decisionReason": null,
"recordedAt": "2024-05-11T09:00:00+00:00",
"fieldMask": []
},
"status": "fixed"
}
],
"provenance": [
{
"source": "redhat",
"kind": "enrich",
"value": "cve-2024-5678",
"decisionReason": null,
"recordedAt": "2024-05-11T09:05:00+00:00",
"fieldMask": []
},
{
"source": "redhat",
"kind": "map",
"value": "rhsa-2024:0252",
"decisionReason": null,
"recordedAt": "2024-05-11T09:00:00+00:00",
"fieldMask": []
}
]
}
],
"aliases": [
"CVE-2024-5678",
"RHSA-2024:0252"
],
"canonicalMetricId": null,
"credits": [],
"cvssMetrics": [
{
"baseScore": 6.7,
"baseSeverity": "medium",
"provenance": {
"source": "redhat",
"kind": "map",
"value": "rhsa-2024:0252",
"decisionReason": null,
"recordedAt": "2024-05-11T09:00:00+00:00",
"fieldMask": []
},
"vector": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"version": "3.1"
}
],
"cwes": [],
"description": null,
"exploitKnown": false,
"language": "en",
"mergeHash": null,
"modified": "2024-05-11T08:15:00+00:00",
"provenance": [
{
"source": "redhat",
"kind": "enrich",
"value": "cve-2024-5678",
"decisionReason": null,
"recordedAt": "2024-05-11T09:05:00+00:00",
"fieldMask": []
},
{
"source": "redhat",
"kind": "map",
"value": "rhsa-2024:0252",
"decisionReason": null,
"recordedAt": "2024-05-11T09:00:00+00:00",
"fieldMask": []
}
],
"published": "2024-05-10T19:28:00+00:00",
"references": [
{
"kind": "advisory",
"provenance": {
"source": "redhat",
"kind": "map",
"value": "rhsa-2024:0252",
"decisionReason": null,
"recordedAt": "2024-05-11T09:00:00+00:00",
"fieldMask": []
},
"sourceTag": "redhat",
"summary": "Red Hat security advisory",
"url": "https://access.redhat.com/errata/RHSA-2024:0252"
}
],
"severity": "critical",
"summary": "Updates the Red Hat Enterprise Linux kernel to address CVE-2024-5678.",
"title": "Important: kernel security update"
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics.Metrics;
@@ -56,7 +56,6 @@ public sealed class OsvGhsaParityDiagnosticsTests
var measurements = new List<(string Instrument, long Value, IReadOnlyDictionary<string, object?> Tags)>();
using var listener = CreateListener(measurements);
using StellaOps.TestKit;
OsvGhsaParityDiagnostics.RecordReport(report, "");
listener.Dispose();

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;
using System.Linq;
@@ -114,7 +114,6 @@ public sealed class ProvenanceDiagnosticsTests
var measurements = new List<(string Instrument, long Value, IReadOnlyDictionary<string, object?> Tags)>();
using var listener = CreateListener(measurements, "concelier.range.primitives");
using StellaOps.TestKit;
ProvenanceDiagnostics.RecordRangePrimitive("source-D", range);
listener.Dispose();

View File

@@ -8,12 +8,13 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Storage.Postgres.Models;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres.Models;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// Integration tests for <see cref="AdvisoryCanonicalRepository"/>.

View File

@@ -8,12 +8,13 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Storage.Postgres.Models;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres.Models;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
using Xunit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// Idempotency tests for Concelier advisory storage operations.

View File

@@ -1,12 +1,13 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Storage.Postgres.Models;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres.Models;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// Integration tests for <see cref="AdvisoryRepository"/>.

View File

@@ -8,12 +8,13 @@
using System.Reflection;
using Dapper;
using FluentAssertions;
using StellaOps.Concelier.Persistence.Postgres;
using Npgsql;
using StellaOps.TestKit;
using Testcontainers.PostgreSql;
using Xunit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// Migration tests for Concelier.Storage.

View File

@@ -1,9 +1,9 @@
using System.Reflection;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Infrastructure.Postgres.Testing;
using Xunit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// PostgreSQL integration test fixture for the Concelier module.

View File

@@ -8,12 +8,13 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Storage.Postgres.Models;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres.Models;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
using Xunit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// Query determinism tests for Concelier storage operations.

View File

@@ -6,15 +6,16 @@
// -----------------------------------------------------------------------------
using FluentAssertions;
using StellaOps.Concelier.Persistence.Postgres;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Interest;
using StellaOps.Concelier.Interest.Models;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// Integration tests for <see cref="InterestScoreRepository"/>.

View File

@@ -6,6 +6,7 @@
// -----------------------------------------------------------------------------
using FluentAssertions;
using StellaOps.Concelier.Persistence.Postgres;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Moq;
@@ -13,11 +14,11 @@ using StellaOps.Concelier.Cache.Valkey;
using StellaOps.Concelier.Core.Canonical;
using StellaOps.Concelier.Interest;
using StellaOps.Concelier.Interest.Models;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// Integration tests for <see cref="InterestScoringService"/> with real PostgreSQL

View File

@@ -1,12 +1,13 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Storage.Postgres.Models;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres.Models;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// Integration tests for <see cref="KevFlagRepository"/>.

View File

@@ -3,12 +3,12 @@ using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Core.Linksets;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using StellaOps.Infrastructure.Postgres.Options;
using Xunit;
namespace StellaOps.Concelier.Storage.Postgres.Tests.Linksets;
namespace StellaOps.Concelier.Persistence.Tests.Linksets;
[Collection(ConcelierPostgresCollection.Name)]
public sealed class AdvisoryLinksetCacheRepositoryTests : IAsyncLifetime

View File

@@ -1,12 +1,13 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Storage.Postgres.Models;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres.Models;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Concelier.Storage.Postgres.Tests;
namespace StellaOps.Concelier.Persistence.Tests;
/// <summary>
/// Integration tests for <see cref="MergeEventRepository"/>.

View File

@@ -2,12 +2,12 @@ using System.Diagnostics;
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Concelier.Storage.Postgres.Models;
using StellaOps.Concelier.Storage.Postgres.Repositories;
using StellaOps.Concelier.Persistence.Postgres.Models;
using StellaOps.Concelier.Persistence.Postgres;
using StellaOps.Concelier.Persistence.Postgres.Repositories;
using Xunit;
using Xunit.Abstractions;
namespace StellaOps.Concelier.Storage.Postgres.Tests.Performance;
namespace StellaOps.Concelier.Persistence.Tests.Performance;
/// <summary>
/// Performance benchmark tests for advisory repository operations.
@@ -74,7 +74,7 @@ public sealed class AdvisoryPerformanceTests : IAsyncLifetime
_output.WriteLine($"Inserted {advisoryCount} advisories with children in {sw.ElapsedMilliseconds}ms ({sw.ElapsedMilliseconds / (double)advisoryCount:F2}ms/advisory)");
var count = await _repository.CountAsync();
count.Should().BeGreaterOrEqualTo(advisoryCount);
count.Should().BeGreaterThanOrEqualTo(advisoryCount);
sw.ElapsedMilliseconds.Should().BeLessThan(30_000, "bulk insert should complete within 30 seconds");
}

Some files were not shown because too many files have changed in this diff Show More