Files
mxaccessgw/src/ZB.MOM.WW.MxGateway.Tests/ProjectStructure/WindevCiContractTests.cs
T
Joseph Doherty f40409a688
ci / nightly-windev (push) Has been skipped
ci / windows-x86 (push) Successful in 1m16s
ci / java (push) Successful in 2m5s
ci / portable (push) Failing after 5m9s
docs: strip task-tracking IDs from code comments and fill missing XML docs
Tracking IDs are review bookkeeping that rots in shipped source; the rationale they tagged is kept. Comment-only change (CommentChecker 458 -> 16 false positives).
2026-10-07 15:34:32 -04:00

56 lines
2.0 KiB
C#

namespace ZB.MOM.WW.MxGateway.Tests.ProjectStructure;
/// <summary>Pins the structure of the windev worker CI script.</summary>
public sealed class WindevCiContractTests
{
/// <summary>Verifies live mode runs the Windows test tiers in the documented order.</summary>
[Fact]
public void LiveMode_RunsWindowsTiersInDocumentedOrder()
{
DirectoryInfo repositoryRoot = FindRepositoryRoot();
string script = File.ReadAllText(
Path.Combine(repositoryRoot.FullName, "scripts", "ci", "windev-worker-ci.ps1"));
string[] orderedSteps =
[
"Invoke-Native 'x86 Worker build'",
"Invoke-Native 'x86 Worker.Tests'",
"Invoke-Native 'full slnx build'",
"Invoke-Native 'gateway tests on Windows'",
"Invoke-Native 'live-MXAccess smoke'",
];
int previousIndex = -1;
foreach (string step in orderedSteps)
{
int currentIndex = script.IndexOf(step, StringComparison.Ordinal);
Assert.True(currentIndex >= 0, $"Missing windev live-mode step: {step}");
Assert.True(currentIndex > previousIndex, $"Windev live-mode step is out of order: {step}");
previousIndex = currentIndex;
}
Assert.Contains(
"dotnet test $gatewayTests -c Release --no-build",
script,
StringComparison.Ordinal);
}
private static DirectoryInfo FindRepositoryRoot()
{
DirectoryInfo? current = new(AppContext.BaseDirectory);
while (current is not null)
{
if (File.Exists(Path.Combine(current.FullName, "CLAUDE.md"))
&& Directory.Exists(Path.Combine(current.FullName, "src"))
&& Directory.Exists(Path.Combine(current.FullName, "scripts")))
{
return current;
}
current = current.Parent;
}
throw new InvalidOperationException("Could not locate the repository root from the test output directory.");
}
}