Skip to content

feat: render Mockolate benchmarks on the docs site#30

Merged
vbreuss merged 2 commits into
mainfrom
feat/mockolate-benchmarks-page
May 3, 2026
Merged

feat: render Mockolate benchmarks on the docs site#30
vbreuss merged 2 commits into
mainfrom
feat/mockolate-benchmarks-page

Conversation

@vbreuss

@vbreuss vbreuss commented May 3, 2026

Copy link
Copy Markdown
Member

Adds a 6-library ranked-bar benchmark visualization for Mockolate that mirrors the existing aweXpect benchmark page but extends to all six mocking libraries Mockolate compares against (Mockolate, Moq, NSubstitute, FakeItEasy, TUnit.Mocks, Imposter).

  • MockolateBenchmarks Nuke target: fetches limited-data.js from the Testably/Mockolate benchmarks branch, splits each chart key into a scenario plus optional [Params] value, and reduces it to one snapshot entry per scenario. Wired into the Pages target's DependsOn chain.
  • MockolateBenchmarkResult React component: renders all libraries sorted fastest-first, with Mockolate highlighted as the baseline and every other row showing its ratio relative to Mockolate (e.g. 1.50x). Inline parameter tabs surface the [Params(1, 10)] variants.
  • Seeded src/data/mockolate/benchmarks.json from the live benchmarks branch (commit 4c61cdf5) so npm start / npm run build work without network access in clean checkouts.

Adds a 6-library ranked-bar benchmark visualization for Mockolate that
mirrors the existing aweXpect benchmark page but extends to all six
mocking libraries Mockolate compares against (Mockolate, Moq,
NSubstitute, FakeItEasy, TUnit.Mocks, Imposter).

- MockolateBenchmarks Nuke target: fetches limited-data.js from the
  Testably/Mockolate benchmarks branch, splits each chart key into a
  scenario plus optional [Params] value, and reduces it to one snapshot
  entry per scenario. Wired into the Pages target's DependsOn chain.
- MockolateBenchmarkResult React component: renders all libraries
  sorted fastest-first, with Mockolate highlighted as the baseline and
  every other row showing its ratio relative to Mockolate (e.g. 1.50x).
  Inline parameter tabs surface the [Params(1, 10)] variants.
- Seeded src/data/mockolate/benchmarks.json from the live benchmarks
  branch (commit 4c61cdf5) so npm start / npm run build work without
  network access in clean checkouts.
@vbreuss vbreuss self-assigned this May 3, 2026
Copilot AI review requested due to automatic review settings May 3, 2026 13:19
@vbreuss vbreuss added the documentation Improvements or additions to documentation label May 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Mockolate benchmark support to the docs site by introducing a new Nuke data-ingestion target, seeding benchmark data into the Docusaurus app, and adding a React component/CSS pair to render multi-library benchmark comparisons alongside the existing docs aggregation pipeline.

Changes:

  • Added a new MockolateBenchmarks Nuke target and wired it into the Pages build pipeline.
  • Seeded Mockolate benchmark snapshot data under Docs/pages/src/data/mockolate/.
  • Added a new MockolateBenchmarkResult component and styles to render ranked time/memory comparisons with parameter tabs and sparklines.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Pipeline/Build.Pages.cs Hooks Mockolate benchmark generation into the docs build pipeline.
Pipeline/Build.MockolateBenchmarks.cs Fetches and reduces upstream Mockolate benchmark data into the site’s JSON shape.
Docs/pages/src/data/mockolate/benchmarks.json Seeds the docs app with a committed Mockolate benchmark snapshot for offline/local builds.
Docs/pages/src/components/MockolateBenchmarkResult/styles.module.css Adds layout and responsive styling for the new benchmark visualization.
Docs/pages/src/components/MockolateBenchmarkResult/index.tsx Implements the new benchmark rendering component with ratios, tabs, and sparklines.
.nuke/build.schema.json Exposes the new Nuke target in the generated build schema.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Docs/pages/src/components/MockolateBenchmarkResult/index.tsx Outdated
Comment thread Docs/pages/src/components/MockolateBenchmarkResult/index.tsx Outdated
Comment thread Pipeline/Build.Pages.cs
- pages.yml: trigger the Pages workflow when Build.MockolateBenchmarks.cs
  changes too, so reducer-only fixes redeploy the docs.
- MockolateBenchmarkResult: drop role="tablist"/role="tab" — the param
  toggle is a button group, not a real tab pattern (no panel linkage,
  no roving tabIndex, no arrow-key handling). Use aria-pressed instead
  so screen readers announce it as a toggle.
- MockolateBenchmarkResult: render libraries with no sample for the
  scenario as italicised "not available" rows rather than dropping
  them silently. The seeded snapshot has no TUnitMocks data for the
  Indexer benchmark and that absence was previously hidden.
- docusaurus.config.ts: migrate onBrokenMarkdownLinks under
  markdown.hooks (the top-level option is deprecated for Docusaurus v4).
@vbreuss
vbreuss merged commit 139356d into main May 3, 2026
2 checks passed
@vbreuss
vbreuss deleted the feat/mockolate-benchmarks-page branch May 3, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants