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

Build: Remove cypress from monorepo #19303

Merged
merged 12 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 0 additions & 173 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ executors:
environment:
NODE_OPTIONS: --max_old_space_size=3076
resource_class: <<parameters.class>>
sb_cypress_8_node_14:
parameters:
class:
description: The Resource class
type: enum
enum: ['small', 'medium', 'medium+', 'large', 'xlarge']
default: 'medium'
working_directory: /tmp/storybook
docker:
# ⚠️ The Cypress docker image is based on Node.js one so be careful when updating it because it can also
# cause an upgrade of Node.js version too. Cypress 8.5 image is based on Node.js 14
- image: cypress/included:8.7.0
environment:
NODE_OPTIONS: --max_old_space_size=3076
resource_class: <<parameters.class>>
sb_playwright:
parameters:
class:
Expand Down Expand Up @@ -184,85 +169,6 @@ jobs:
root: .
paths:
- .verdaccio-cache
e2e-tests-extended:
executor:
class: medium
name: sb_cypress_8_node_14
parallelism: 14
steps:
- when:
condition:
and:
- not:
equal: [main, << pipeline.git.branch >>]
- not:
equal: [next, << pipeline.git.branch >>]
steps:
- ensure-pr-is-labeled-with:
label: 'run e2e extended test suite'
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: running local registry
command: |
cd code
yarn local-registry --port 6001 --open
background: true
- run:
name: Wait for registry
command: |
cd code
yarn wait-on http://localhost:6001
- run:
name: Run E2E (extended) tests
command: |
cd code
yarn test:e2e-framework --clean --all --skip angular --skip angular12 --skip vue3 --skip web_components_typescript --skip cra --skip react
no_output_timeout: 5m
- store_artifacts:
path: /tmp/cypress-record
destination: cypress
e2e-tests-core:
executor:
class: large
name: sb_cypress_8_node_14
parallelism: 8
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Running local registry
command: |
cd code
yarn local-registry --port 6001 --open
background: true
- run:
name: Wait for registry
command: |
cd code
yarn wait-on http://localhost:6001
- run:
name: Run E2E (core) tests
# Do not test CRA here because it's done in PnP part
# TODO: Remove `web_components_typescript` as soon as Lit 2 stable is released
command: |
cd code
yarn test:e2e-framework vue3 angular130 angular13 angular12 web_components_typescript web_components_lit2 react react_legacy_root_api
no_output_timeout: 5m
- run:
name: prep artifacts
when: always
command: zip -r /tmp/storybook-e2e-testing-out.zip /tmp/storybook-e2e-testing
- store_artifacts:
path: /tmp/cypress-record
destination: cypress
- store_artifacts:
path: /tmp/storybook-e2e-testing-out.zip
destination: e2e
# NOTE: this currently tests each story in docs mode, which doesn't make sense any more as stories
# can no longer run in docs mode. Instead we should probably change the test runner to test each
# docs entry if you run it in `VIEW_MODE=docs`
Expand Down Expand Up @@ -325,73 +231,6 @@ jobs:
- store_artifacts:
path: /tmp/sb-bench.tar.gz
destination: sb-bench.tar.gz
e2e-tests-pnp:
executor:
class: medium
name: sb_cypress_8_node_14
working_directory: /tmp/storybook
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Running local registry
command: |
cd code
yarn local-registry --port 6001 --open
background: true
- run:
name: Wait for registry
command: |
cd code
yarn wait-on http://localhost:6001
- run:
name: run e2e tests cra
command: |
cd code
yarn test:e2e-framework --pnp cra
# - run:
# name: run e2e tests vue
# command: yarn test:e2e-framework --pnp sfcVue
- run:
name: prep artifacts
when: always
command: zip -r /tmp/storybook-e2e-testing-out.zip /tmp/storybook-e2e-testing
- store_artifacts:
path: /tmp/cypress-record
destination: cypress
- store_artifacts:
path: /tmp/storybook-e2e-testing-out.zip
destination: e2e
e2e-tests-examples:
executor:
class: small
name: sb_cypress_8_node_14
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: running example
command: |
cd code
yarn serve-storybooks
background: true
- run:
name: await running examples
command: |
cd code
yarn await-serve-storybooks
- run:
name: cypress run
command: |
cd code
yarn test:e2e-examples
- store_artifacts:
path: /tmp/cypress-record
destination: cypress
smoke-tests:
executor:
class: medium+
Expand Down Expand Up @@ -591,9 +430,6 @@ workflows:
- examples:
requires:
- build
- e2e-tests-examples:
requires:
- examples
- smoke-tests:
requires:
- build
Expand All @@ -612,15 +448,6 @@ workflows:
- publish:
requires:
- build
- e2e-tests-extended:
requires:
- publish
- e2e-tests-core:
requires:
- publish
- e2e-tests-pnp:
requires:
- publish
- cra-bench:
requires:
- publish
Expand Down
17 changes: 2 additions & 15 deletions CONTRIBUTING.old.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- [2a. Run unit tests](#2a-run-unit-tests)
- [Core & Examples Tests](#core--examples-tests)
- [2b. Run Linter](#2b-run-linter)
- [2c. Run Cypress tests](#2c-run-cypress-tests)
- [Reproductions](#reproductions)
- [In the monorepo](#in-the-monorepo)
- [Outside the monorepo](#outside-the-monorepo)
Expand All @@ -32,8 +31,8 @@
- [Verify your local version is working](#verify-your-local-version-is-working)
- [Documentation](#documentation)
- [Release Guide](#release-guide)
- [Prerelease:](#prerelease)
- [Full release:](#full-release)
- [Prerelease:](#prerelease)
- [Full release:](#full-release)

Thanks for your interest in improving Storybook! We are a community-driven project and welcome contributions of all kinds: from discussion to documentation to bugfixes to feature improvements.

Expand Down Expand Up @@ -129,18 +128,6 @@ It can be immensely helpful to get feedback in your editor, if you're using VsCo

This should enable auto-fix for all source files, and give linting warnings and errors within your editor.

### 2c. Run Cypress tests

First make sure the repo is bootstrapped.

Then run `yarn build-storybooks --all`, this creates a static website from all examples.

Then run `yarn serve-storybooks`, this will run the static site on the port cypress expects.

Then run `yarn add cypress -W --optional`. When this has completed cypress should be installed on your system. If it is already on your system, this step can be skipped.

Then run `yarn cypress open` if you want to see the tests run in the UI, or `yarn cypress run` to run the tests headless.

### Reproductions

#### In the monorepo
Expand Down
1 change: 0 additions & 1 deletion code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ module.exports = {
},
},
{ files: '**/.storybook/config.js', rules: { 'global-require': 'off' } },
{ files: 'cypress/**', rules: { 'jest/expect-expect': 'off' } },
{
files: ['**/*.stories.*'],
rules: {
Expand Down
6 changes: 0 additions & 6 deletions code/cypress/.eslintrc.json

This file was deleted.

5 changes: 0 additions & 5 deletions code/cypress/fixtures/example.json

This file was deleted.

19 changes: 0 additions & 19 deletions code/cypress/generated/addon-action.spec.ts

This file was deleted.

26 changes: 0 additions & 26 deletions code/cypress/generated/addon-backgrounds.spec.ts

This file was deleted.

49 changes: 0 additions & 49 deletions code/cypress/generated/addon-controls.spec.ts

This file was deleted.

30 changes: 0 additions & 30 deletions code/cypress/generated/addon-docs.spec.ts

This file was deleted.

Loading