Skip to content

Conversation

hkfb
Copy link
Collaborator

@hkfb hkfb commented Sep 25, 2025

Replaced for some stories where possible and sensible.

Needed to switch to running tests on static Storybook due to inconsistencies between statically and dynamically generated DOM snapshots.

@hkfb hkfb marked this pull request as ready for review September 25, 2025 08:46
@hkfb hkfb requested a review from w1nklr September 25, 2025 08:47
Storybook test-runner is used to smoke test all stories in each package.

Tests can be run, given a running (`npm run storybook`) or static storybook, using `npm run docker:build && npm run docker:storybook:test`.
Tests can be run using `npm run compose:storybook:test`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this replace the previous version (ie. docker:build and docker:storybook:test), that is running in the docker ?
If so we can remove the docker:* version.
If not, add in the doc how to do it (needed for windows devs to update the ref images).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hoped everyone could use the new compose:* version. Could you give it a try?

DOM snapshots are not the same when running storybook dynamically. In CI it runs static, so you won't be able to create DOM snapshots locally with the previous scripts.

However, for creating screenshots, the dynamic version (docker:*) still works and is probably quicker.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In that case, keep both version in the README and explain the difference.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I deleted a reference .snap file and ran npm run compose:storybook:test => Result was green with a written snapshot :/

Snapshot Summary
› 1 snapshot written from 1 test suite.

Test Suites: 45 passed, 45 total
Tests: 186 passed, 186 total
Snapshots: 1 written, 181 passed, 182 total
Time: 527.003 s
Ran all test suites.

Unfortunately, the EOL was not matching the initial file's EOL :/

A second run failed because of 2 image comparison failures...

Then I deleted a reference .snap file and ran npm run compose:storybook:test:update twice => it ended green, but without restoring the missing .snap file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I deleted a reference .snap file and ran npm run compose:storybook:test => Result was green with a written snapshot :/

Is this new behaviour?

Snapshot Summary
› 1 snapshot written from 1 test suite.
Test Suites: 45 passed, 45 total
Tests: 186 passed, 186 total
Snapshots: 1 written, 181 passed, 182 total
Time: 527.003 s
Ran all test suites.

Unfortunately, the EOL was not matching the initial file's EOL :/

I don't understand how this could happen. Does it fail the tests?

A second run failed because of 2 image comparison failures...

Are the tests more flaky than before?

Then I deleted a reference .snap file and ran npm run compose:storybook:test:update twice => it ended green, but without restoring the missing .snap file.

I haven't seen the update not working before. Can you show me more precisely what you did so that I can try to reproduce it?

const stories: Meta = {
component: NumericInput,
title: "SubsurfaceViewer/Components/Settings",
tags: ["no-screenshot-test"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove corresponding ref images

const stories: Meta = {
component: ToggleButton,
title: "SubsurfaceViewer/Components/Settings",
tags: ["no-screenshot-test"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove corresponding ref images

Copy link
Collaborator

Choose a reason for hiding this comment

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

What caused this change ?

Storybook test-runner is used to smoke test all stories in each package.

Tests can be run, given a running (`npm run storybook`) or static storybook, using `npm run docker:build && npm run docker:storybook:test`.
Tests can be run using `npm run compose:storybook:test`
Copy link
Collaborator

Choose a reason for hiding this comment

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

In that case, keep both version in the README and explain the difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants