Skip to content

Refactor test jobs into execution-family templates - #5341

Merged
mattleibow merged 4 commits into
mainfrom
mattleibow-test-job-templates
Oct 13, 2026
Merged

mattleibow merged 4 commits into
mainfrom
mattleibow-test-job-templates

Conversation

@mattleibow

@mattleibow mattleibow commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Share repeated test-job setup and publishing through three reusable templates, with the differences passed explicitly by stage callers:

  • Desktop: shared SDK/Tizen setup, native inputs, visual extraction, TRX/log publication and optional coverage output. Calls supply names, arguments, GPU environment, packages and pre-steps.
  • Containers: shared Docker execution, no host SDK installation, native inputs, common GPU declaration and result publication. Calls supply the image, native platform and job/log values.
  • Devices/WASM: shared native inputs, SDK defaults and result publication. Calls supply target/arguments, emulator/browser pre-steps, GPU environment, SDK overrides and differing setup values.

The templates contain no runtime/platform/image switches. Stage composition and agent selection remain explicit, including the dedicated Android agent; coverage collection and its dependencies stay in the stage. Outer pipeline gating, managed/MSBuild/Samples jobs and the bootstrapper are unchanged.

All 15 test-job display names are unique, so test-run titles are derived as displayName + " Tests". Coverage artifact names are derived by replacing the job name's tests_ prefix with coverage_, leaving Core callers with only publishCoverage: true. Existing coverage artifact names remain unchanged.

The complete refactor removes 208 lines overall, including explicit caller configuration and the directly affected documentation updates. This is a separate main-based refactor, not part of #5339 or #5314. No native, SDK-version, test-policy or test-execution changes.

Related issues

None. Separate from #5339 and #5314.

Required skia PR

None.

Areas affected

  • Managed API (binding/)
  • Native / C API (externals/skia/src/c, include/c)
  • Generated P/Invoke bindings
  • Native dependency or Skia update (libpng, HarfBuzz, FreeType, zlib, milestone bump, …)
  • Views & integrations (MAUI, Uno, WPF, WinUI, Blazor, …)
  • Rendering output / visual behavior
  • Performance
  • Tests
  • Build, packaging, or CI
  • Documentation or samples

Changes

No public API or product-runtime changes.

CI result labels: test-run titles now use each job's display name followed by Tests. Ten existing labels are simplified; for example, Windows .NET Core Tests becomes Windows (.NET Core) Tests, and Android Tests (API ...) becomes Android Tests. Device versions remain in setup arguments and log artifact names. All 15 titles remain unique. Test execution, artifact names and coverage collection are unchanged.

Testing

Passed: actual public Azure pipeline 345 (mono-SkiaSharp) previewRun: true expansion with identical default template parameters at exact refs/versions:

Input Exact revision
refs/heads/main d41f3583b8b43e9d4ea9b1e55257a498147bcb40
refs/heads/mattleibow-test-job-templates 9c5fd64d76f6564e0fc50604abf972794a8c5ec1

Across 12 stages / 92 jobs, all executable settings, job identities, pools, conditions, retries, provisioning, SDK/workload selection, step order, GPU environment, artifacts and dependency graphs match main except the explicitly verified display-derived test-run titles. The comparison asserts each of the 15 published titles equals that job's displayName + " Tests", asserts all 15 are unique, and permits only those exact title replacements; it does not ignore result-task contents generally. The three coverage artifact names and collector dependencies remain unchanged. Source checks also confirm unchanged non-test stages and test-stage dependency branches.

Automatic CI: public pipeline 345 build 1632922 was automatically triggered by this PR and is in progress (not yet a passed run). Its triggerInfo.pr.sourceSha is 9c5fd64d76f6564e0fc50604abf972794a8c5ec1, and its producing merge revision is 0a988bfdd2ab4f8c2fadb987b152746499270362. No build was manually queued.

Exact validation commands and results

Helper scripts, requests/responses, expanded YAML and comparison proof are session artifacts, not repository additions.

python3 /Users/matthew/.copilot/session-state/4373b194-465a-4d1b-bc0d-2a3b3e6e35e9/files/validate-test-templates.py syntax
# PASSED: YAML parses, caller parameters valid, one shared job per family; other stages, test metadata and coverage unchanged.

git diff --check origin/main...HEAD
# PASSED.

python3 /Users/matthew/.copilot/session-state/4373b194-465a-4d1b-bc0d-2a3b3e6e35e9/files/validate-test-templates.py preview main refs/heads/main d41f3583b8b43e9d4ea9b1e55257a498147bcb40 complete
# PASSED: actual Azure previewRun:true, pinned main baseline.

python3 /Users/matthew/.copilot/session-state/4373b194-465a-4d1b-bc0d-2a3b3e6e35e9/files/validate-test-templates.py preview derived-head refs/heads/mattleibow-test-job-templates 9c5fd64d76f6564e0fc50604abf972794a8c5ec1 complete
# PASSED: actual Azure previewRun:true, pinned latest feature head.

python3 /Users/matthew/.copilot/session-state/4373b194-465a-4d1b-bc0d-2a3b3e6e35e9/files/validate-test-templates.py compare complete derived-head true
# PASSED: 15 unique display-derived titles; everything outside those exact title labels matches, including coverage artifacts/dependencies.

Each preview uses az rest --method post --url 'https://dev.azure.com/dnceng-public/public/_apis/pipelines/345/runs?api-version=7.1' --resource 499b84ac-1321-427f-aa17-267ca6975798 --headers Content-Type=application/json --body @<saved-request.json> --output json, with previewRun: true, templateParameters: {}, and repository self pinned to the corresponding ref and SHA above.

Not run: product/native/device/desktop/consumer execution, bootstrap or SDK/workload installation: this is YAML-only refactoring, and local runtime runs are paused. No product tests were added because no product code or test execution changes. Optional test-only yamlOverride preview was not retried: the companion investigation established that Azure requires unavailable EditBuild permission for modified YAML. Existing test-only source conditions remain unchanged.

Checklist

  • Tests added or updated (if omitted, explain why above)
  • Changes above lists all public API and behavioral changes (or "None.")
  • New/changed public API? Added or updated accurate source /// documentation and regenerated bindings when applicable
  • Native change? Companion mono/skia PR linked above and bindings regenerated

Keep test-stage composition, agent selection, and coverage collection in the stage while fixed desktop, container, and device/WASM templates own their existing execution settings. Preserve job identities, ordering, GPU declarations, SDK selection, and artifact behavior.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 4373b194-465a-4d1b-bc0d-2a3b3e6e35e9
@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

Add the automation/staging label to build and publish a documentation preview for this PR.

Removing the label removes the preview. While the label is present, each new commit updates it.


This comment is automatically updated by the documentation staging workflow.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

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 -- 5341

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5341"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-5341/packages --name skiasharp-pr-5341
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-5341

Share one bootstrapper definition per execution family rather than moving repeated job bodies. Keep only fixed runtime/image metadata and target-specific provisioning differences, retaining existing execution settings and stage composition.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 4373b194-465a-4d1b-bc0d-2a3b3e6e35e9
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

📊 SkiaSharp benchmarks — PR #5341

⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS

Informational only — this never blocks the PR. 🟢 faster / less allocation · 🔴 slower / more allocation; moves under 5% are hidden as noise.

⏱️ Times are raw BenchmarkDotNet means, and the ⭐ PR and baseline legs run on separate CI runners, so microbenchmarks can swing run-to-run — treat small time deltas as noise. Allocations are deterministic and the reliable signal. The interactive perf-dashboard (linked below) applies smoothing for the trend view.

Highlights

⏱️ Time — 🔴 40 slower · 🟢 39 faster

  • 🔴 ColorMathBenchmark.ToColor(Colors: 4096) · Linux · 6.10 µs → 14.17 µs (+132%)
  • 🔴 ColorMathBenchmark.PreMultiply(Colors: 4096) · Linux · 7.55 µs → 14.09 µs (+87%)
  • 🔴 MatrixMapPointsBenchmark.MapPoints(Points: 4096) · Linux · 1.39 µs → 2.59 µs (+86%)
  • 🔴 ColorParseBenchmark.Parse(Iterations: 1000) · Linux · 42.49 µs → 74.32 µs (+75%)
  • 🔴 RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) · Linux · 154.32 µs → 264.90 µs (+72%)
  • …and 74 more (see details below)
Full per-OS benchmark deltas

Linux

⏱️ Time (vs 🌙 nightly 4.156.0-nightly.26511.1)

Benchmark baseline this PR Δ
ColorMathBenchmark.ToColor(Colors: 4096) 6.10 µs 14.17 µs 🔴 +132%
ColorMathBenchmark.PreMultiply(Colors: 4096) 7.55 µs 14.09 µs 🔴 +87%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 1.39 µs 2.59 µs 🔴 +86%
ColorParseBenchmark.Parse(Iterations: 1000) 42.49 µs 74.32 µs 🔴 +75%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 154.32 µs 264.90 µs 🔴 +72%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 64.27 µs 109.77 µs 🔴 +71%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 7.25 µs 12.10 µs 🔴 +67%
PathBoundsBenchmark.TightBounds(Points: 64) 607.9 ns 1.00 µs 🔴 +65%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 127.3 ns 208.9 ns 🔴 +64%
ColorMathBenchmark.ToColorF(Colors: 4096) 8.07 µs 13.11 µs 🔴 +62%
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 46.48 µs 74.01 µs 🔴 +59%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 587.63 µs 928.24 µs 🔴 +58%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 2.95 µs 4.63 µs 🔴 +57%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 157.53 µs 246.39 µs 🔴 +56%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 1.27 ms 1.97 ms 🔴 +55%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 229.99 µs 354.18 µs 🔴 +54%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 4.94 ms 7.58 ms 🔴 +53%
MatrixOpsBenchmark.Concat(Count: 4096) 142.61 µs 217.53 µs 🔴 +53%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 1.74 ms 2.62 ms 🔴 +51%
PathBoundsBenchmark.TightBounds(Points: 1024) 6.76 µs 10.21 µs 🔴 +51%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 897.02 µs 1.33 ms 🔴 +48%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 464.52 µs 684.91 µs 🔴 +47%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 120.63 µs 173.87 µs 🔴 +44%
MatrixMapPointsBenchmark.MapVector(Points: 256) 7.73 µs 11.05 µs 🔴 +43%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 9.69 µs 13.59 µs 🔴 +40%
…and 9 more

Windows

⏱️ Time (vs 🌙 nightly 4.156.0-nightly.26511.1)

Benchmark baseline this PR Δ
ColorMathBenchmark.ToColor(Colors: 4096) 21.16 µs 7.92 µs 🟢 -63%
RuntimeEffectShaderBenchmark.DrawFrame 1.15 ms 614.22 µs 🟢 -46%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 2.24 µs 1.20 µs 🟢 -46%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 171.3 ns 95.5 ns 🟢 -44%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 248.69 µs 140.25 µs 🟢 -44%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 326.10 µs 184.77 µs 🟢 -43%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 933.61 µs 536.28 µs 🟢 -43%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 1.24 ms 722.12 µs 🟢 -42%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 2.14 ms 1.27 ms 🟢 -41%
ColorMathBenchmark.PreMultiply(Colors: 4096) 13.05 µs 7.72 µs 🟢 -41%
CanvasDrawBenchmark.Draw(Shapes: 512) 21.14 ms 12.61 ms 🟢 -40%
CanvasDrawBenchmark.Draw(Shapes: 64) 2.65 ms 1.59 ms 🟢 -40%
SceneRenderBenchmark.RenderFrame(Complexity: 4) 9.98 ms 6.04 ms 🟢 -39%
ColorParseBenchmark.Parse(Iterations: 1000) 75.39 µs 46.81 µs 🟢 -38%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 11.42 µs 7.18 µs 🟢 -37%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 2.60 ms 1.65 ms 🟢 -36%
ColorMathBenchmark.ToColorF(Colors: 4096) 13.26 µs 8.45 µs 🟢 -36%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 10.25 ms 6.57 ms 🟢 -36%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 4.73 µs 3.22 µs 🟢 -32%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 2.96 ms 2.04 ms 🟢 -31%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 776.86 µs 539.02 µs 🟢 -31%
PathBoundsBenchmark.TightBounds(Points: 1024) 15.60 µs 10.86 µs 🟢 -30%
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 76.02 µs 53.30 µs 🟢 -30%
PathBoundsBenchmark.TightBounds(Points: 64) 1.52 µs 1.09 µs 🟢 -28%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 129.87 µs 93.13 µs 🟢 -28%
…and 9 more

macOS

⏱️ Time (vs 🌙 nightly 4.156.0-nightly.26511.1)

Benchmark baseline this PR Δ
MatrixOpsBenchmark.Invert(Count: 4096) 96.26 µs 71.22 µs 🟢 -26%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 227.07 µs 272.88 µs 🔴 +20%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 705.86 µs 820.71 µs 🔴 +16%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 943.79 µs 1.09 ms 🔴 +16%
CanvasDrawBenchmark.Draw(Shapes: 64) 1.66 ms 1.91 ms 🔴 +15%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 157.9 ns 178.1 ns 🔴 +13%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 1.73 µs 1.87 µs 🔴 +8%
ColorParseBenchmark.Parse(Iterations: 1000) 67.74 µs 73.24 µs 🔴 +8%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 165.43 µs 153.43 µs 🟢 -7%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 45.94 µs 43.13 µs 🟢 -6%
MatrixMapPointsBenchmark.MapVector(Points: 256) 2.80 µs 2.64 µs 🟢 -6%

📈 Full interactive perf-dashboard & run details →

v and others added 2 commits October 13, 2026 04:01
Keep reusable family templates focused on shared SDK setup, native inputs and result publication. Configure each job's names, arguments, environment, artifacts and provisioning steps explicitly at its stage call site instead of switching on runtime or platform inside the templates.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 4373b194-465a-4d1b-bc0d-2a3b3e6e35e9
Use each unique test-job display name plus Tests for its published run title. Derive coverage artifact names from the existing tests_ job prefix, so Core callers pass only publishCoverage. Test execution and coverage collection remain unchanged; only the displayed run titles are simplified.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 4373b194-465a-4d1b-bc0d-2a3b3e6e35e9
@mattleibow
mattleibow marked this pull request as ready for review October 13, 2026 03:30
@mattleibow
mattleibow merged commit 888e7b3 into main Oct 13, 2026
114 of 119 checks passed
@mattleibow
mattleibow deleted the mattleibow-test-job-templates branch October 13, 2026 03:31
@github-actions github-actions Bot added this to the 4.156.0-rc.1 milestone Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant