#How committed is the Storybook team to maturing the test runner?

7 messages · Page 1 of 1 (latest)

primal flare
#

What's the general level of support and development that is planned for the test runner? Will attempts be made to bring it up to speed with the reliability and speed that StoryShots had?

I ask because it seems like the community is currently scrambling to make the test runner run reliably, in order to replace StoryShots, while PRs on the project are not being reviewed or merged.

The snapshot tester is extremely flaky, and I had to take a bunch of measures to stabilise it, before it would run deterministically with co-workers, even though we run it in a docker container. Sometimes snapshots would even show two entirely unrelated stories overlapping in a single snapshot.

We now appear to have been able to stabilise the snapshot tester using three measures we found through experimentation and that of others through GitHub issues:

  async preRender(page, context) {
    // Prevent one story's context from bleeding into the next test run
    await getStoryContext(page, context);
  },

Before taking any snapshots, in postRender():

    // Make sure assets (images, fonts) are loaded and rendered
    await page.waitForLoadState('domcontentloaded')
    await page.waitForLoadState('load')
    await page.waitForLoadState('networkidle');
    await page.waitForFunction(() =>
      document.readyState === 'complete'
      && document.fonts.ready
      // naturalWidth will be zero if image file is not loaded.
      // Fixes flakiness of images in the snapshots.
      && ![...document.images].some(
           ({ naturalWidth, loading }) => !naturalWidth && loading !== 'lazy'
         )
    );

And setting --maxWorkers=5 on the test runner itself.

Questions:

  • Can above measures be incorporated into the test runner somehow?
  • Will PRs be reviewed and merged?
  • Can the decommissioning of StoryShots and the documentation of the test runner be prioritized so that everyone knows this is the way forward, and users don't spend time try to get StoryShots to run?
rustic kindle
#

@zealous vault @fringe sedge ⬆️

zealous vault
#

Apologies for the slow response here. We're committed to the test runner and transitioning folks off Storyshots ahead of Storybook 8.0. We've been focused on other pieces of the SB ecosystem for the first half of this year, but will be picking things up during the second half. We've got some massive improvements ahead.

Can above measures be incorporated into the test runner somehow?

Yes, if you submit a PR and include a good way to reproduce the problems you're experiencing, we'd be happy to evaluate it.

Will PRs be reviewed and merged?

Yes, but you'll need to be patient. Some PRs are easier to merge than others.

Can the decommissioning of StoryShots and the documentation of the test runner be prioritized so that everyone knows this is the way forward, and users don't spend time try to get StoryShots to run?

Yes, we will prioritize this. We've got a draft in progress but don't have a public ETA yet.

primal flare
#

Thanks!

lean fable
#

I've reported issues with upgrading to the latest test-runner over a week ago but haven't heard back from anyone.

upgrading to 0.11.0 has caused the command to merge lcov reports to fail due to missing coverage files; to be clear it is working great on 0.10.0.

zealous vault
fringe sedge
#

That issue was fixed in a prerelease and I made a stable release containing it a couple days ago, please try it out!