Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update E2E tests Docs to accomodate for running in Monorepos #306

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

thafryer
Copy link
Member

@thafryer thafryer commented Nov 2, 2023

We had a customer try setting up E2E Visual tests in a monorepo (Yarn workspaces) and run into issues. This updates the docs to leverage their workaround until we improve the onboarding workflow.

@thafryer thafryer requested review from elseloop and skitterm November 2, 2023 14:29
Copy link

linear bot commented Nov 2, 2023

AP-3614 Supporting Yarn workspaces

What?

With a Yarn workspace, we could automatically identify where the Storybook config and archive locations are in ancestor directories of the file system, without the user having to specify..

Background

A customer that is using e2e had this issue (Their playwright tests were in a subproject, but everything was installed at the root level since they use hoisting). They were able to get things working by specifying where the Storybook config is (using the -c option with the build-storybook command, and telling chromatic build-script-name=build-storybook instead of build-archive-storybook) and the archive location ( CHROMATIC_ARCHIVE_LOCATION), but it'd be nice if our CLI were smart enough to look at the root for the config file.

Details

This user is using yarn v3, not sure how common that is.

They were able to get around specifying the build-script-name by disabling hoisting at the workspace level, but of course that's not ideal:

I have also got chromaui working in the workspace correctly without a the custom "build-storybook" script by adding the following to the package.json:

"installConfig": {"hoistingLimits": "workspaces"}

Copy link

netlify bot commented Nov 2, 2023

👷 Deploy request for chromatic-docs pending review.

A Netlify team Owner will need to approve the deploy before you can run your build.

Are you a team Owner? Visit the deploys page to approve it

Need more help? Learn more in the Netlify docs

Name Link
🔨 Latest commit 40d94e8

Copy link

github-actions bot commented Nov 2, 2023

@github-actions github-actions bot temporarily deployed to pull request November 2, 2023 14:31 Inactive
Copy link
Member

@skitterm skitterm left a comment

Choose a reason for hiding this comment

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

@thafryer Thanks for putting this together. Some syntax will need to change (/latest should now be chromatic-archives), but even with changes I was unable to get things working correctly as I had with the user I helped.

If you have time to pair on this today, I think we could figure it out quickly and know what to document.

@elseloop elseloop force-pushed the jarel/ap-3614-supporting-yarn-workspaces branch from 5993a37 to 9434774 Compare November 3, 2023 21:04
@github-actions github-actions bot temporarily deployed to pull request November 3, 2023 21:06 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 3, 2023 21:12 Inactive
Copy link
Contributor

@elseloop elseloop left a comment

Choose a reason for hiding this comment

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

@thafryer I added some small changes for clarity, but this looks great—thank you!

@elseloop elseloop merged commit f49b5a1 into main Nov 3, 2023
4 checks passed
@elseloop elseloop deleted the jarel/ap-3614-supporting-yarn-workspaces branch November 3, 2023 21:15
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.

3 participants