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

@@ -22,7 +22,8 @@ public class CallgraphIngestionTests : IClassFixture<SignalsTestFactory>
this.factory = factory;
}
[Theory]
[Trait("Category", TestCategories.Unit)]
[Theory]
[InlineData("java")]
[InlineData("nodejs")]
[InlineData("python")]
@@ -74,7 +75,8 @@ public class CallgraphIngestionTests : IClassFixture<SignalsTestFactory>
Assert.Equal(body.SchemaVersion, manifest.SchemaVersion);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task Ingest_UnsupportedLanguage_ReturnsBadRequest()
{
using var client = factory.CreateClient();
@@ -86,7 +88,8 @@ public class CallgraphIngestionTests : IClassFixture<SignalsTestFactory>
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task Ingest_InvalidArtifactContent_ReturnsBadRequest()
{
using var client = factory.CreateClient();
@@ -98,7 +101,8 @@ public class CallgraphIngestionTests : IClassFixture<SignalsTestFactory>
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task Ingest_InvalidGraphStructure_ReturnsUnprocessableEntity()
{
using var client = factory.CreateClient();
@@ -111,7 +115,8 @@ public class CallgraphIngestionTests : IClassFixture<SignalsTestFactory>
Assert.True((int)response.StatusCode >= 400);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task Ingest_SameComponentUpsertsDocument()
{
using var client = factory.CreateClient();
@@ -128,6 +133,7 @@ public class CallgraphIngestionTests : IClassFixture<SignalsTestFactory>
Assert.Equal(HttpStatusCode.Accepted, secondResponse.StatusCode);
using var scope = factory.Services.CreateScope();
using StellaOps.TestKit;
var repo = scope.ServiceProvider.GetRequiredService<ICallgraphRepository>();
var doc = await repo.GetByIdAsync((await secondResponse.Content.ReadFromJsonAsync<CallgraphIngestResponse>())!.CallgraphId, CancellationToken.None);

View File

@@ -17,10 +17,12 @@ public class SignalsApiTests : IClassFixture<SignalsTestFactory>
this.factory = factory;
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task Callgraph_Ingest_Response_Includes_Extended_Fields()
{
using var client = factory.CreateClient();
using StellaOps.TestKit;
client.DefaultRequestHeaders.Add("X-Scopes", "signals:write signals:read");
var req = CallgraphIngestionTests.CreateRequest("java", component: "api-test", version: "1.2.3");

View File

@@ -17,7 +17,8 @@ public class SyntheticRuntimeProbeTests : IClassFixture<SignalsTestFactory>
this.factory = factory;
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task SyntheticProbe_Generates_Runtime_Facts_And_Scoring()
{
using var client = factory.CreateClient();
@@ -47,6 +48,7 @@ public class SyntheticRuntimeProbeTests : IClassFixture<SignalsTestFactory>
Assert.Equal(HttpStatusCode.OK, factRes.StatusCode);
var factJson = await factRes.Content.ReadAsStringAsync();
using var doc = JsonDocument.Parse(factJson);
using StellaOps.TestKit;
Assert.True(doc.RootElement.TryGetProperty("states", out var states));
Assert.True(states.GetArrayLength() > 0);
Assert.True(doc.RootElement.TryGetProperty("runtimeFacts", out var runtimeFacts));