Skip to content

Commit 3b39e6d

Browse files
committed
fix(build): skip NugetPackageTest on non-macOS CI platforms
The Avalonia GUI smoke test requires a display server which is only available on macOS CI runners. Add OnlyWhenDynamic guard to skip the target on Linux/Windows and make the runtime critical-path governance check platform-aware for the smoke telemetry evidence. Made-with: Cursor
1 parent 1539379 commit 3b39e6d

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

build/Build.Governance.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,16 +550,18 @@ private static void ValidateRuntimeCriticalPathExecutionEvidence()
550550
if (string.Equals(id, "package-consumption-smoke", StringComparison.Ordinal))
551551
{
552552
var telemetryExists = File.Exists(NugetSmokeTelemetryFile);
553+
var smokeTestAvailable = OperatingSystem.IsMacOS();
553554
checks.Add(new
554555
{
555556
id,
556557
lane,
557558
evidenceType = "nuget-smoke-telemetry",
558559
telemetryPath = NugetSmokeTelemetryFile.ToString(),
559-
passed = telemetryExists
560+
passed = telemetryExists,
561+
skippedReason = smokeTestAvailable ? (string?)null : "GUI smoke test requires macOS display server"
560562
});
561563

562-
if (!telemetryExists)
564+
if (smokeTestAvailable && !telemetryExists)
563565
failures.Add($"Scenario '{id}' requires NuGet smoke telemetry evidence at '{NugetSmokeTelemetryFile}'.");
564566
}
565567

build/Build.Packaging.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ private sealed record NugetPackagesRootResolution(string Path, string Source);
323323
internal Target NugetPackageTest => _ => _
324324
.Description("Packs, restores, builds, and runs the NuGet package integration smoke test end-to-end.")
325325
.DependsOn(ValidatePackage)
326+
.OnlyWhenDynamic(() => OperatingSystem.IsMacOS(), "Avalonia GUI smoke test requires a display server (macOS CI only)")
326327
.Executes(async () =>
327328
{
328329
var packedVersion = ResolvePackedAgibuildVersion("Agibuild.Fulora.Avalonia");

0 commit comments

Comments
 (0)