f40409a688
Tracking IDs are review bookkeeping that rots in shipped source; the rationale they tagged is kept. Comment-only change (CommentChecker 458 -> 16 false positives).
56 lines
2.0 KiB
C#
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.");
|
|
}
|
|
}
|