fix: clear runtime folders once before workers start, not per spec#1121
Merged
wswebcreation merged 4 commits intomainfrom Feb 24, 2026
Merged
fix: clear runtime folders once before workers start, not per spec#1121wswebcreation merged 4 commits intomainfrom
wswebcreation merged 4 commits intomainfrom
Conversation
) Move clearRuntimeFolder logic from BaseClass constructor (runs per worker) to VisualLauncher.onPrepare (runs once in main process before workers). Refactor: extract storybook logic from launcher into storybook/hooks.ts and move the launcher out of the storybook/ directory to make it a general-purpose service launcher. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: 7424078 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Fixes #683
Setting
clearRuntimeFolder: truewas clearing the actual and diff folders after each spec/feature execution instead of once at the start of the test run. This caused only the last spec's visual data to survive when running multiple specs in parallel.Root cause: The clearing logic lived in the
BaseClassconstructor, which is called every timeWdioImageComparisonServiceis instantiated — once per worker (i.e., once per spec file). So each new worker would wipe out the results from previously completed workers.Fix:
BaseClassconstructor_clearRuntimeFolders()fromprivatetoprotectedVisualLauncher.onPrepare(), which runs exactly once in the main process before any workers are spawnedRefactor — Launcher & Storybook separation:
The
VisualLauncherclass was previously located atsrc/storybook/launcher.ts, which was misleading since it serves as the general-purpose service launcher for all modes (not just Storybook). The Storybook-specific logic was interleaved with general launcher concerns.