Repository navigation
Build and validate generated samples in isolated test workspaces - #5308
Conversation
Pin the preview SDK and workload set to the reviewed RC1 versions. Replace obsolete preview Emscripten 5.0.6 jobs and merger inputs with all four 6.0.2 variants, preserving stable toolchains and the existing installer contract. Align source and packaged native references, including the missing packaged Skia net11 boundary. Port the 80 item-selection evaluations into the existing MSBuild suite without replacing its package tests or CI stage. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cbe348b8-ee2b-40c5-b889-86aaead009c0
Keep RC1 terminology on the SDK/workload pins only; the WASM mapping applies to all net11.0+ targets. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cbe348b8-ee2b-40c5-b889-86aaead009c0
Integrate the landed SDK/workload provisioning refactor. Keep this branch's RC1 preview SDK and workload pins alongside main's split Tizen manifest band/version interface. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cbe348b8-ee2b-40c5-b889-86aaead009c0
Replace imperative sample orchestration with discoverable sample builds and owned Docker HTTP checks, keeping the existing integration and MSBuild suites separate. Use host-controlled dotnet execution, repository-native runner references, retained diagnostics, and exact generated dependency declarations. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
📦 Try the packages from this PRWarning Do not run these scripts without first reviewing the code in this PR. Step 1 — Download the packages bash / macOS / Linux: curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 5308PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5308"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-5308/packages --name skiasharp-pr-5308More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-5308 |
Move build orchestration into SampleTestBase and environment configuration into DotNet. Keep build logs and available binlogs on failure, use current-context file attachment extensions, and nest discovered entry types in SampleLookup. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
📊 SkiaSharp benchmarks — PR #5308⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS
Highlights⏱️ Time — 🔴 57 slower · 🟢 6 faster
Full per-OS benchmark deltasLinux⏱️ Time (vs 🌙 nightly
Windows⏱️ Time (vs 🌙 nightly
macOS⏱️ Time (vs 🌙 nightly
|
Route SDK selection and builds through DotNet.Run with workspace-local defaults and the shared dotnet process configuration. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Use one case source for build and run checks, with a single HTTP-versus-console dispatch. Require both original Docker samples and expose host settings directly through a read-only dictionary. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Keep case generators free of coverage assertions, validate Docker/Basic/Gallery cases independently, and select HTTP Docker execution by the presence of sample.http instead of a folder name. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Keep runtime expectations in explicit sample tests, share HTTP and owned app lifetime handling, and retain separate stdout and stderr diagnostics. Replace ambiguous container copying with DownloadFile and remove synthetic runner scenarios and unused configuration. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Include the normalized sample folder and a GUID in workspace, diagnostic, Docker context, and container names without repeating repository or test prefixes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Minimal .NET containers have no usable default fonts. Embed the existing licensed Noto Sans font, retain font/typeface diagnostics and resolved Web text, and render using the loaded typeface. Include its redistribution license in published output. Add reviewed macOS-host and Linux-container PNG references from real sample executions; leave other platforms pending producing-CI captures rather than substituting references. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Copy Noto Sans to the output root and load it from a file. Remove explicit font-load throws, temporary font diagnostics, and the diagnostic-only test assertion; use rendered PNG comparisons as proof. Keep short font attribution and license links in all four Noto Sans sample READMEs instead of standalone license files. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Focus on package acquisition, direct test entry points, host/consumer isolation, SDK selection, and retained diagnostics. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Keep build and runtime selection consistent for host-specific solutions and Dockerfiles while leaving each test's arguments and assertions explicit. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Declare the existing NoDependencies native project alongside SkiaSharp so sample generation retains an exact-cohort Linux package reference. Cover both Console and Web in the generated dependency contract; the producing Linux runtime checks previously failed before rendering because libSkiaSharp.so was absent. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Generate consumer references from the exact staged SkiaSharp and HarfBuzzSharp package identities, rather than a later job's build counter. Preserve package-free publication and reject incomplete, duplicate, or mismatched cohorts. Provision an owned Colima/QEMU Docker daemon on macOS without nested virtualization or default-context changes. Remove only its profile after sample checks. Add reviewed Linux host references from producing build 1629334, whose four attempts rendered identical PNGs. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Use genuine Host and Nano Server Console/Web captures from producing build 1629446 at source 9a1e242. Each of four attempts passed all checks except missing references and produced byte-identical captures. Keep zero-tolerance comparisons unchanged. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Keep per-channel tolerance at zero and bound the number of differing decoded pixels using exact decimal arithmetic. Cover exact and fractional boundaries, both sample sizes, and one-level color/alpha changes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Use explicit producing versions, validate actual generated projects, and keep Docker availability diagnostics in tests with CI-owned PATH setup. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Retry ENOTEMPTY once only when the remaining owned tree contains .DS_Store metadata and directories. Preserve failures for unrelated residue, symlinks, errors and persistent writers, and retain Windows cleanup bounds. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Keep setup, explicit package-version arguments, direct test commands and failure diagnostics. Remove CI run history and implementation detail from the guide. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Keep concise prerequisites, sample-local run commands, and a short guide to using each application. Remove implementation inventories and repository-only instructions from exported sample documentation. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Add a temporary dependency-free AcesShared diagnostic stage with checkout disabled. Report installed Docker CLI paths, context, client/server versions, and bounded daemon probes without provisioning Docker or modifying shared resources. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Use Homebrew only when Docker is unavailable, in both the quick diagnostic and actual sample job. Disable automatic Homebrew updates and cleanup, propagate installation failures, and keep daemon provisioning out of scope. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Declare macOS exclusions for Docker build and runtime tests, retaining ordinary macOS sample builds and host runtimes. Remove Homebrew Docker setup and the temporary AcesShared diagnostic stage now that Linux and Windows own container validation. Add regression coverage for the declared exclusions and update maintainer instructions. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Remove blanket macOS exclusions while retaining the existing bounded availability probe. Keep macOS CI provisioning removed, allow local container builds and runtimes, and guard against reintroducing platform-wide skips. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Declare product project references before the source-only Uno import. In-tree builds retain the helper's platform selection, while generation converts the same references into artifact-versioned packages without an Exists fallback. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Load SkiaSharp and its net10 macOS/Win32 native-assets dependencies alongside the Samples runner. Document the net10 solution invocation so the dependency projects do not build their entire shipping framework matrix. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Default TestingPlatformCaptureOutput to false while respecting caller overrides. Enable live xUnit output and plain runner formatting without changing the SDK terminal logger, TRX reporting, or hang protection. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Move the default from the unrelated device runner to RunDotNetTest. Exercised the actual Cake helper with default false and caller-supplied true; both focused runs passed and retained TRX/hang arguments. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Route platform and optional coverage defaults through the cloned property dictionary so caller overrides are preserved and properties are emitted once. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
There was a problem hiding this comment.
🟡 Changes recommended
Several rewritten sample quick-starts omit the required native bootstrap, so their commands are incomplete on a clean checkout.
4 open findings
What changed in this PR
Introduces isolated, package-based sample validation as a standard .NET test suite, with host and Docker execution integrated into Cake and CI.
Changes:
- Adds isolated sample workspaces, build/runtime tests, package validation, and PNG comparisons.
- Replaces imperative Cake sample orchestration with
dotnet testand CI result publication. - Updates sample dependencies, bundled fonts, and developer documentation.
| File | Description |
|---|---|
tests/SkiaSharp.Tests.Samples/Utils/SampleWorkspace.cs |
Creates isolated consumer workspaces. |
tests/SkiaSharp.Tests.Samples/Utils/SampleTestBase.cs |
Shares sample preparation/build logic. |
tests/SkiaSharp.Tests.Samples/Utils/SampleLookup.cs |
Discovers host-eligible samples. |
tests/SkiaSharp.Tests.Samples/Utils/SampleImage.cs |
Validates PNGs and goldens. |
tests/SkiaSharp.Tests.Samples/Utils/SampleArtifacts.cs |
Publishes bounded diagnostics. |
tests/SkiaSharp.Tests.Samples/Utils/RunningApp.cs |
Manages executable sample lifecycles. |
tests/SkiaSharp.Tests.Samples/Utils/Repo.cs |
Defines repository test paths. |
tests/SkiaSharp.Tests.Samples/Utils/ProcessRunner.cs |
Runs bounded child processes. |
tests/SkiaSharp.Tests.Samples/Utils/DotNetRunningApp.cs |
Hosts running .NET samples. |
tests/SkiaSharp.Tests.Samples/Utils/DotNet.cs |
Builds and launches package consumers. |
tests/SkiaSharp.Tests.Samples/Utils/DockerSampleFixture.cs |
Builds and cleans Docker resources. |
tests/SkiaSharp.Tests.Samples/Utils/DockerRunningApp.cs |
Controls running containers. |
tests/SkiaSharp.Tests.Samples/SkiaSharp.Tests.Samples.csproj |
Configures the new test runner. |
tests/SkiaSharp.Tests.Samples/SampleInfrastructureTests.cs |
Tests isolation and diagnostics infrastructure. |
tests/SkiaSharp.Tests.Samples/SampleDiscoveryTests.cs |
Verifies generated case coverage. |
tests/SkiaSharp.Tests.Samples/GallerySampleTests.cs |
Builds generated Gallery solutions. |
tests/SkiaSharp.Tests.Samples/DockerSampleTests.cs |
Exercises Docker samples. |
tests/SkiaSharp.Tests.Samples/BasicSampleTests.cs |
Builds and runs Basic samples. |
tests/SkiaSharp.Tests.Samples/AssemblyInfo.cs |
Serializes sample tests. |
tests/SkiaSharp.Tests.Samples/ArtifactContractTests.cs |
Validates package cohorts and versions. |
tests/SkiaSharp.Tests.Samples.slnx |
Provides an IDE/test solution. |
scripts/infra/tests/test-shared.cake |
Adds configurable builds and live output. |
scripts/infra/samples/samples.cake |
Replaces build loops with the test suite. |
scripts/azure-templates-stages-test.yml |
Publishes sample results and diagnostics. |
samples/SkiaFiddle/SkiaFiddle.csproj |
Enables generated SkiaSharp version stamping. |
samples/SkiaFiddle/README.md |
Revises usage documentation. |
samples/SkiaFiddle/Media/README.md |
Updates media attribution text. |
samples/Gallery/Uno/SkiaSharpSample.Uno.csproj |
Adds generated-package prerequisites. |
samples/Gallery/Uno/README.md |
Simplifies Uno usage guidance. |
samples/Gallery/README.md |
Revises Gallery instructions. |
samples/Gallery/Maui/README.md |
Simplifies MAUI guidance. |
samples/Basic/Web/SkiaSharpSample/SkiaSharpSample.csproj |
Adds Linux native assets. |
samples/Basic/UnoPlatform/SkiaSharpSample/SkiaSharpSample.csproj |
Adds Uno package prerequisites. |
samples/Basic/UnoPlatform/README.md |
Removes an obsolete cross-reference. |
samples/Basic/DockerWebApi/SkiaSharpSample/SkiaSharpSample.csproj |
Publishes the bundled font. |
samples/Basic/DockerWebApi/SkiaSharpSample/Program.cs |
Uses bundled Noto Sans. |
samples/Basic/DockerWebApi/README.md |
Documents font use and licensing. |
samples/Basic/DockerConsole/SkiaSharpSample/SkiaSharpSample.csproj |
Publishes the bundled font. |
samples/Basic/DockerConsole/SkiaSharpSample/Program.cs |
Uses bundled Noto Sans. |
samples/Basic/DockerConsole/README.md |
Documents font use and licensing. |
samples/Basic/Console/SkiaSharpSample/SkiaSharpSample.csproj |
Adds Linux native assets. |
samples/Basic/BlazorWebAssembly/README.md |
Adds Noto Sans licensing. |
samples/Basic/Android/README.md |
Adds Noto Sans licensing. |
documentation/dev/building-samples.md |
Documents the new test workflow. |
build.cake |
Routes sample validation through tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Run generated browser samples with Playwright (#5312) Context: #5308 Context: #5291 Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1633875 Validate package-consuming sample applications through their actual browser UIs while keeping the test runner backed by repository source. Extend the generated-sample foundation with browser interactions, reviewed screenshots and explicit execution lifetimes rather than synthetic rendering apps. Carry forward the browser slice of #5291 above the merged #5308 foundation. Keep HTTP image checks independent of browser page checks, and retain the separate Integration/MSBuild suites and their existing references. ~~ Exercise the generated applications, not substitute scenes ~~ Add named runtime facts for Basic Web, BrowserWebAssembly, Blazor CPU/GPU and Drawing, and Uno CPU/Drawing. Build and launch generated copies against the staged producing package cohort; the runner retains its SkiaSharp ProjectReference and native import. Add BrowserWebAssembly's native-assets project reference so generation also supplies its SkiaSharp.NativeAssets.WebAssembly package dependency. Extend the artifact-contract theory to check that generated reference. Blazor Drawing selects colors and brush size, creates pointer strokes, checks their pixels and clears them. Uno selects its declared net10.0-browserwasm project target, waits beyond the splash screen, exercises Drawing navigation and strokes, clears the canvas and returns to CPU rendering. Its readiness check requires the rendered blue/purple scene, not merely an existing canvas. ~~ Own browser lifetime and retain errors across operations ~~ BrowserRunningApp wraps the existing RunningApp rather than introducing another server lifecycle. Callback completion disposes the browser context and Chromium; the enclosing host callback retains process cleanup and logs. Reuse the host's cached address and same-origin request validation for browser navigation. Recognize BrowserWASM's "App url:" output alongside "Now listening on:", accepting HTTP on 127.0.0.1 with a nonzero port. Collect console errors and page exceptions across the callback. Assert after navigation, element waits, screenshots and callback completion so errors between operations or direct Page interactions cannot disappear. Sentinel regressions verify multiple console errors and asynchronous page exceptions. Retain a failure screenshot when execution fails before its first normal capture. ~~ Distinguish stable pixel goldens from animated GPU smoke checks ~~ Capture full pages with a 1280x900 viewport, device scale 1 and light color scheme. Add nine reviewed page references for each of Linux, macOS and Windows, including drawn and cleared states. Consolidate ValidateFile, SaveAndValidate and CompareGolden into file and byte-array SampleImage.Validate overloads with SampleImageOptions. Save supplied bytes before checking the PNG signature, then compare dimensions and pixels. ExpectedSize preserves fixed-size HTTP and Console assertions; omitted options retain the 0.075% differing-pixel budget with zero channel tolerance. Missing references fail without creating replacements. The animated Blazor GPU page instead uses a 6% mean absolute RGBA error, normalized by pixel count, four channels and 255. This replaces, rather than supplements, the differing-pixel criterion. It is a coarse smoke check: uniform dark output can pass, and arbitrary animation frames are not strict rendering goldens. Do not freeze the sample clock or infer deterministic frame equivalence from this result. Regression tests cover explicit pixel budgets, alpha-inclusive mean error, the exact 6% boundary and rejection one channel step beyond the boundary. ~~ Preserve diagnostic snapshots instead of masking image failures ~~ Actual and expected captures can share a basename, and a capture may be attached more than once. Duplicate xUnit attachment names could obscure the real pixel mismatch with an attachment exception. Give expected images an expected- prefix and assign repeated names numeric suffixes in SampleArtifacts. Keep actual, expected and diff evidence distinct while retaining the existing 8 MiB embedding limit and on-disk artifacts. Regressions exercise same-basename mismatches and repeated diagnostic snapshots. ~~ Select declared frameworks without retargeting dependencies ~~ Use one optional DotNetOptions record across BuildSample, DotNet.Build and callback-based DotNet.Run; name raw command execution Execute. Options cover configuration, framework, additional properties, working directory and timeout, with Release remaining the sample default. Pass framework selection through --framework rather than overriding TargetFramework or TargetFrameworks. Protect configuration and helper-owned restore properties from additional-property overrides. A compiling regression selects net10.0-windows while referenced projects retain their netstandard2.1 and net10.0 targets. Keep inherited PATH selection and private consumer caches. Preserve 30-minute build and one-minute raw-command defaults. A run timeout controls address and exit waits, not callback duration or browser-operation waits; cleanup and output reads retain their one-minute bounds. Tests cover property forwarding, working directories, argument boundaries, invalid options and cleanup after timed-out waits. ~~ Make build coverage and runtime coverage independently visible ~~ Combine the former BasicSampleTests and GallerySampleTests compilation theories in SampleBuildTests. Retain Console and HTTP execution in BasicSampleRunTests, put ordinary browser execution in BrowserSampleRunTests and isolate Uno's framework-specific startup in UnoBrowserSampleRunTests. Split DockerSampleTests into DockerSampleBuildTests and DockerSampleRunTests. Both retain the Docker execution group: an image build requires a daemon even though it is compilation coverage. Browser facts and browser-error regressions use Host; infrastructure and generated compilation remain Build. Discovery regressions check eligible Basic/Gallery cases and the shared Docker fixture. ~~ Separate sample preparation from Docker resource ownership ~~ Replace Utils/SampleTestBase with root-level DotNetSampleTestBase and add DockerSampleTestBase beside the test classes. The .NET base owns its prepared workspace; the Docker base stages a flat selected-sample context, local packages and relative NuGet feed, then deletes that context after building. Do not impose common inheritance on these different workspace lifetimes. Reuse SampleWorkspace.CopyTree instead. Context tests check selected inputs, excluded bin/obj directories, package staging and an empty-cohort failure. DockerSampleFixture retains daemon policy, cached images, registered tags, container callbacks and resource cleanup. Register a tag before its build and cache it after success. Share the fixture across Docker build/run classes so the split does not create independent image caches. Put CLI syntax and command bounds behind named Docker operations such as Ps, Build, Run, Port, Wait and Logs. Fixture and running-app code call those operations rather than constructing argument arrays. ~~ Serialize shared resources without blocking unrelated collections ~~ Remove AssemblyInfo.cs's assembly-wide DisableTestParallelization setting. BrowserSampleRunTests and UnoBrowserSampleRunTests share one serial browser collection; Docker build/run classes share another for their mutable image cache and resource registry. Neither collection sets DisableParallelization=true, so unrelated collections can run concurrently. Normal xUnit serialization within a class or collection still applies, including SampleBuildTests theory rows. A reflection regression checks the assembly policy, browser assignments and nonexclusive collection definitions. ~~ Install the matching browser at the CI execution boundary ~~ Add Microsoft.Playwright 1.55.0 and a CI-only pre-test Chromium installation target. Pass SampleRunGroup from Cake so Host and unfiltered runs install Chromium, while Build and Docker groups do not. Keep local installation an explicit documented prerequisite rather than a fixture or discovery download. Preserve the canonical eight Samples jobs and existing provisioning. Build 1633875 succeeded for source ffb7ec0 through merge 97bfa39. Samples results were Linux Build 134, Host 14 and Docker 4; macOS Build 140 and Host 14; Windows Build 141, Host 14 and Docker 4. Those completed groups reported zero failures and skips. Windows Host passed on its second attempt without a source change after WebSampleReturnsImage exceeded the existing four-second HTTP timeout. This records a successful retry, not a timeout fix or proof that the failure cannot recur. Co-authored-by: Matthew Leibowitz <[email protected]> Co-authored-by: Copilot App <[email protected]>

Description
Make generated sample validation an ordinary .NET test suite that can run in CI, from the command line, or in an IDE. This replaces the imperative sample-build orchestration in
samples.cakewith discoverable tests, while keeping sample generation as an explicit prerequisite.The suite validates the applications we distribute against one producing build's NuGet packages—not repository project references. Each test copies only its selected sample and required configuration into an isolated workspace, with private caches and SDK/import boundaries. Diagnostics survive cleanup, and cleanup touches only resources owned by the test.
What to review
RunDotNetTestlive progress/output and overridable platform/coverage defaults. TRX and hang diagnostics are retained.The existing Integration and MSBuild suites, their entry points, device tests, and goldens remain in place. Browser execution and additional consumer SDK lanes are separate work. Dockerfiles retain their .NET 10 images; the Docker samples bundle Noto Sans so text rendering does not depend on container-installed fonts.
See Building and Validating Samples for package acquisition, generation, and local execution.
Related issues
Related to #5291 and #5297. This is the standalone samples foundation; consolidation remains in #5291, and consumer SDK lanes are in #5314.
Required skia PR
None.
Areas affected
binding/)externals/skia/src/c,include/c)Changes
Public API: None; no shipped managed API or native ABI changes.
Behavior: Docker sample text uses a bundled font. Sample validation checks exact image dimensions and allows at most 0.075% changed pixels with zero channel tolerance; references are never accepted automatically. Shared Cake test runs show live progress/output and respect explicit platform/coverage property overrides. Core rendering comparisons and GPU policies are unchanged.
Testing
Full CI: Build 1630344 succeeded with all stages green at source
7ea57f453ff2, before the subsequent shared-helper changes. Its tested merge23e50175f022includes main6e0e83eaa4b8and that source head.The four macOS skips were Docker availability; Windows/Linux Docker checks ran. Linux initially failed before tests on a truncated Emscripten download. A user-authorized Linux-only retry passed; Windows/macOS remained on their original successful attempts. Native, managed, packaging, core Tests, and MSBuild package stages also passed.
Latest helper changes: current head
2180818e7cbhas focused actual-Cake validation, not a new full CI result. Logging defaults/explicit capture overrides were verified at9d297e2fc4ad; platform/coverage defaults and overrides were verified at2180818e7cb. Each probe called the realRunDotNetTest; temporary probe tasks were removed afterwards.Local commands and results
Local sample checks used macOS ARM64 and one unchanged producing package cohort: SkiaSharp
4.156.0-pr.5308.26508.28/ HarfBuzzSharp14.4.0.100-pr.5308.26508.28from build 1629251.dotnet cake --target=samples-generate --previewLabel=pr.5308 --buildNumber=26508.28 --verbosity=quiet— passed.DEVELOPER_DIR=/Applications/Xcode-26.6.0.app/Contents/Developer dotnet test tests/SkiaSharp.Tests.Samples.slnx -c Release -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 -- --filter-trait Category=Infrastructure --report-trx --results-directory "$PWD/output/logs/samples-solution-dependencies"— 88/88 passed, including solution dependency restore/build.DEVELOPER_DIR=/Applications/Xcode-26.6.0.app/Contents/Developer dotnet test tests/SkiaSharp.Tests.Samples/SkiaSharp.Tests.Samples.csproj -c Release -- --filter-trait Category=Infrastructure Category=Docker Category=SampleRun --report-trx --results-directory "$PWD/output/logs/mac-docker-availability-positive"— 94/94 passed, including local macOS containers. Repeating with an unavailable daemon or Docker absent fromPATHgave 90 passed / 4 explicit availability skips / 0 failures each.net10.0-desktopandnet10.0-browserwasm— all four passed, with existing warnings and no errors.dotnet cake scripts/infra/samples/samples.cake --target=logging-helper-probe --verbosity=diagnosticand the same command with--capture=true— 1/1 passed each at9d297e2fc4ad. Expanded commands preserved defaultTestingPlatformCaptureOutput=falseversus explicittrue; live heartbeats/output, TRX, and hang arguments were checked. No--tl:offor subprocess-streaming rewrite.dotnet cake scripts/infra/samples/samples.cake --target=property-defaults-probe --coverage=true --verbosity=diagnostic, the same command with--override-properties=true, and the same target without--coverage=true— 1/1 passed each for the2180818e7cbchange. Actual commands emitted properties once, preserved explicit overrides (including a spaced output path), and omitted coverage defaults when disabled. The caller dictionary remained unchanged. This proves argument handling, not coverage instrumentation.git diff --check— passed.An earlier unfiltered local run at
6625db5af967was interrupted by premature MSBuild child exits, without a final summary/TRX. Its last progress count is not a passing gate; the completed CI result above is the full-suite evidence.Screenshots (before / after)
Checklist
Changesabove lists all public API and behavioral changes (or "None.")///documentation and regenerated bindings when applicablemono/skiaPR linked above and bindings regeneratedThe final two items are not applicable: no shipped API or native changes.