mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-27 09:01:13 +00:00
[AZ-1124] Add PT-10 gRPC stream perf scenario
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using FluentAssertions;
|
||||
using SatelliteProvider.IntegrationTests;
|
||||
|
||||
namespace SatelliteProvider.Tests;
|
||||
|
||||
public class PerfBootstrapPt10Tests
|
||||
{
|
||||
[Fact]
|
||||
public void Percentile_MatchesHarnessFormula_AZ1124_AC2()
|
||||
{
|
||||
var values = new long[] { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
|
||||
|
||||
PerfBootstrap.Percentile(values, 50).Should().Be(50);
|
||||
PerfBootstrap.Percentile(values, 95).Should().Be(100);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PerfScript_DoesNotInlineJwtMint_AZ1124_AC6()
|
||||
{
|
||||
var path = LocateRepoFile(Path.Combine("scripts", "run-performance-tests.sh"));
|
||||
path.Should().NotBeNull();
|
||||
|
||||
var content = File.ReadAllText(path!);
|
||||
content.Should().Contain("--run-pt10");
|
||||
content.Should().NotContain("JwtSecurityToken");
|
||||
content.Should().NotContain("new JwtSecurityToken(");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Program_DispatchesRunPt10Subcommand_AZ1124_AC1()
|
||||
{
|
||||
var path = LocateRepoFile(Path.Combine("SatelliteProvider.IntegrationTests", "Program.cs"));
|
||||
path.Should().NotBeNull();
|
||||
|
||||
var content = File.ReadAllText(path!);
|
||||
content.Should().Contain("--run-pt10");
|
||||
content.Should().Contain("RunPt10Async");
|
||||
}
|
||||
|
||||
private static string? LocateRepoFile(string relativePath)
|
||||
{
|
||||
var dir = new DirectoryInfo(Directory.GetCurrentDirectory());
|
||||
while (dir is not null)
|
||||
{
|
||||
var candidate = Path.Combine(dir.FullName, relativePath);
|
||||
if (File.Exists(candidate))
|
||||
{
|
||||
return candidate;
|
||||
}
|
||||
|
||||
dir = dir.Parent;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,7 @@
|
||||
<ProjectReference Include="..\SatelliteProvider.Common\SatelliteProvider.Common.csproj" />
|
||||
<ProjectReference Include="..\SatelliteProvider.DataAccess\SatelliteProvider.DataAccess.csproj" />
|
||||
<ProjectReference Include="..\SatelliteProvider.TestSupport\SatelliteProvider.TestSupport.csproj" />
|
||||
<ProjectReference Include="..\SatelliteProvider.IntegrationTests\SatelliteProvider.IntegrationTests.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user