feat: render Mockolate benchmarks on the docs site#30
Merged
Conversation
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.
There was a problem hiding this comment.
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
MockolateBenchmarksNuke target and wired it into thePagesbuild pipeline. - Seeded Mockolate benchmark snapshot data under
Docs/pages/src/data/mockolate/. - Added a new
MockolateBenchmarkResultcomponent 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.
- 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).