Skip to content

Skills M4 (5/9): the Vitest addon hosts the test toolset and serves the story-test tool - #35731

Closed
valentinpalkovic wants to merge 1 commit into
valentin/m4-04-review-createfrom
valentin/m4-05-test-run-on-addon-vitest
Closed

valentinpalkovic wants to merge 1 commit into
valentin/m4-04-review-createfrom
valentin/m4-05-test-run-on-addon-vitest

Conversation

@valentinpalkovic

Copy link
Copy Markdown
Contributor

Closes #

Part 5 of 9 of the Skills M4 migration. Stacked on #35730, replaces #35677.

What I did

The tool that runs story tests for an agent lives in the MCP addon today, even though everything it drives belongs to the Vitest addon. Ownership moves where it belongs: the Vitest addon now hosts the test toolset, and the tool is served from there. The MCP addon only exposes it.

Behavior change worth its own look: the tool used to be offered whenever @storybook/addon-vitest was merely installed. It is now offered when the addon is actually enabled in the Storybook configuration. A project that has the package in its dependencies but never added it to its addons list will stop seeing the tool. That is the correct answer, because the tool could not have run a single test there anyway, but it is a visible difference for anyone in that state. A new end-to-end fixture models exactly that setup so the case stays covered.

A second, smaller change in the same area: a request where only some of the named stories resolve now fails loudly. Previously the tool quietly ran the ones it could find and reported a verdict as though that had been the whole request, which means an agent could be told its tests passed when part of what it asked for never ran. It now reports which selectors did not resolve. A request where nothing at all matched still comes back as a plain result with the reasons attached, exactly as before.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Caution

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

  1. Build the monorepo packages with yarn nx run-many -t compile.
  2. In test-storybooks/mcp, run yarn install and then yarn storybook. The MCP endpoint comes up at http://localhost:6006/mcp.
  3. Point an MCP client at that endpoint and call run-story-tests for a component that has stories. The pass/fail summary, the failure details and the accessibility section should read as they did before.
  4. Call it with a filter that matches nothing, and confirm you get a "no stories matched" answer with the reasons rather than an error.
  5. Now remove @storybook/addon-vitest from the addons list in that Storybook's configuration while leaving the package installed, restart, and confirm the tool no longer appears in the tool list at all. Put it back and confirm it returns.

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Declare whether manual QA will be needed for this PR during the next release, through qa:needed or qa:skip

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

@valentinpalkovic valentinpalkovic added the maintenance User-facing maintenance tasks label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b0f6f23a-ed12-41b0-826a-275a6d03b444

📥 Commits

Reviewing files that changed from the base of the PR and between 0b4f55c and 66b9ebf.

📒 Files selected for processing (29)
  • code/addons/mcp/src/mcp-handler.ts
  • code/addons/mcp/src/preset.test.ts
  • code/addons/mcp/src/storybook-ai-metadata.test.ts
  • code/addons/mcp/src/telemetry.test.ts
  • code/addons/mcp/src/telemetry.ts
  • code/addons/mcp/src/test-support/register-core-toolsets.ts
  • code/addons/mcp/src/tools/get-storybook-story-instructions.test.ts
  • code/addons/mcp/src/tools/get-storybook-story-instructions.ts
  • code/addons/mcp/src/tools/run-story-tests.test.ts
  • code/addons/mcp/src/tools/run-story-tests.ts
  • code/addons/mcp/src/tools/tool-registry.test.ts
  • code/addons/mcp/src/tools/tool-registry.ts
  • code/addons/mcp/src/types.ts
  • code/addons/mcp/src/utils/addon-vitest.ts
  • code/addons/mcp/src/utils/find-story-ids.test.ts
  • code/addons/mcp/src/utils/find-story-ids.ts
  • code/addons/mcp/src/utils/get-tool-availability.ts
  • code/addons/mcp/src/utils/slash.ts
  • code/addons/vitest/src/preset.test.ts
  • code/addons/vitest/src/preset.ts
  • code/core/src/core-server/index.ts
  • code/core/src/shared/open-service/toolsets/test/definition.test.ts
  • code/core/src/shared/open-service/toolsets/test/definition.ts
  • code/core/src/shared/open-service/toolsets/test/format.ts
  • code/core/src/shared/open-service/toolsets/test/run.test.ts
  • code/core/src/shared/open-service/toolsets/test/run.ts
  • test-storybooks/mcp/.storybook-no-vitest/main.ts
  • test-storybooks/mcp/.storybook-no-vitest/preview.ts
  • test-storybooks/mcp/tests/mcp-addon-vitest-not-enabled.e2e.test.ts

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫

PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily","ci:docs"]

🚫

PR is not labeled with one of: ["qa:needed","qa:skip","qa:success"]

🚫 PR title must be in the format of "Area: Summary", With both Area and Summary starting with a capital letter Good examples: - "Docs: Describe Canvas Doc Block" - "Svelte: Support Svelte v4" Bad examples: - "add new api docs" - "fix: Svelte 4 support" - "Vue: improve docs"
🚫 This PR needs an approving review from a Storybook Core or Developer Experience team member before it can be merged.
Warnings
⚠️

This PR targets valentin/m4-04-review-create. The default branch for contributions is next. Please make sure you are targeting the correct branch.

Generated by 🚫 dangerJS against 66b9ebf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance User-facing maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant