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

Storybook: different port for each module #2837

Closed
4 tasks done
dsebastien opened this issue Apr 8, 2020 · 9 comments
Closed
4 tasks done

Storybook: different port for each module #2837

dsebastien opened this issue Apr 8, 2020 · 9 comments
Labels
community This is a good first issue for contributing outdated scope: storybook Issues related to Storybook support in Nx stale type: feature

Comments

@dsebastien
Copy link

dsebastien commented Apr 8, 2020

Prerequisites

Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version
  • I checked the documentation (nx.dev) and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (not related to React, Angular or any dependency)

Expected Behavior

It would be nice to be able to run Cypress e2e tests in parallel against different libraries configured with Storybook.

Current Behavior

What is the current behavior?

Errors about ports already being used when executing npm run affected:e2e -- --headless --base=remotes/origin/master --head=HEAD --parallel

My current workaround is to manually change the port for each project through angular.json and cypress.json so that there are no port conflicts

Apparently, the issue also happens without running in parallel.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Create a workspace with multiple libraries
  2. Configure Storybook for each lib
  3. Execute the above command
@FrozenPandaz FrozenPandaz added community This is a good first issue for contributing scope: storybook Issues related to Storybook support in Nx type: feature labels Apr 8, 2020
@aivascu
Copy link

aivascu commented Apr 9, 2020

This fails for me even when not running in parallel.
I have a project with multiple libs all of which are configured by default to run on port 4400.
When I run

> npm run e2e

The next storybook instance picks the next available port e.g 4401 but it still waits for the iframe to popup on 4400 which is busy with another storybook instance.
I tried explicitly specifying the port on the e2e project config inside angular.json, but on launch it errors saying I can't specify the port there.

@dsebastien dsebastien changed the title Storybook: different port for each module to support parallel execution Storybook: different port for each module Apr 9, 2020
@dsebastien
Copy link
Author

Indeed, you're right; I assumed it was caused by the --parallel option

@dsebastien
Copy link
Author

@FrozenPandaz it feels like a bug to me; am I wrong?

@samvloeberghs
Copy link

We are experiencing a similar issue, probably the same.

Reproduction can be found here:

https://github.com/elisa-dc/test-storybook

Steps to reproduce:

git clone git@github.com:elisa-dc/test-storybook.git
cd test-storybook
npm i
npx nx e2e --headless

credits to @elisa-dc

@aivascu
Copy link

aivascu commented May 29, 2020

@dsebastien @samvloeberghs I was able to find a workaround to run all the e2e tests sequentially using the run-many task:

> nx run-many --target=e2e --all

It looks like this turns off storybook between test runs, which allows the tests to pass. Unfortunately this does not work with the --parallel attribute.
@samvloeberghs I was able to run all e2e tests on your reproduction repo using this command.

@github-actions
Copy link

github-actions bot commented Feb 3, 2021

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@averath
Copy link

averath commented Mar 5, 2021

I have the same problem since 11.2.0 version of @nrwl/cypress

@juristr
Copy link
Member

juristr commented Mar 5, 2021

@averath have a look at #3953. I have an idea how storybook Cypress runs could be parallelized, but that requires some changes on the storybook lib as well.

Subscribe to that issue there to get updates on the progress

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community This is a good first issue for contributing outdated scope: storybook Issues related to Storybook support in Nx stale type: feature
Projects
None yet
Development

No branches or pull requests

6 participants