Files
satellite-provider/SatelliteProvider.Tests/PerfBootstrapPt10Tests.cs
T
Oleksandr Bezdieniezhnykh 7dac986996
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status
[AZ-1124] Add PT-10 gRPC stream perf scenario
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 11:26:14 +03:00

57 lines
1.6 KiB
C#

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;
}
}