-
Notifications
You must be signed in to change notification settings - Fork 296
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
Create npm workspace for E2E tests #10119
base: develop
Are you sure you want to change the base?
Conversation
Build files for 2d318a0 are ready:
|
Note the one failing E2E test will be fixed in #10111 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @benbowler. Nice work, but we need to move more dependencies. Please, see my comments.
Co-authored-by: Eugene Manuilov <[email protected]>
…olve path to modules.
I found that the scripts workspace scripts appeared to be running with mixed npm versions and found However, one thing to note is that the workspace wants the root package to be upgraded as well so To me it seems that trying to run multiple npm versions is causing more problems than it's worth. Back in my first implementation I sent to review with globally installed npm v7, I had the workspaces and E2E tests working. With #6026 in EB, what do you think about requiring npm v7 globally in the interim, all devs need to do is run |
I'm open to suggestions if you can get the dev dependency method working reliably, allowing install commands and scripts to run reliably at the root and package level. |
One possible way to avoid this is by updating packages in the workspace like this for now: |
@@ -30,11 +30,10 @@ | |||
"test:js": "cross-env BABEL_ENV=test NODE_ENV=test jest --config=tests/js/jest.config.js --passWithNoTests", | |||
"test:js:watch": "npm run test:js -- --watch", | |||
"test:storybook": "npm run test:js -- --testMatch '<rootDir>/.storybook/*.test.js'", | |||
"pretest:e2e": "./bin/local-env/env-check.sh && ./tests/e2e/bin/test-docker-connectivity", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaemnnosttv suggested removing the pretest command as it's not needed to be run from root.
Removed @aaemnnosttv I tried npm 9 then 8 but these failed to install packages the following error so I've stuck with npm v7 and this can upgrade along with future node.js updates.
Later npm versions also have different module resolution rules which causes an issue with these now deprecated modules. If we upgrade to later npm versions we will need to resolve this issue so as not to run all install/ci commands with
|
@eugene-manuilov this is now running E2E tests locally and on GH actions, failing checks are existing known instabilities. In terms of the CLA check it appears this joint commit was not verified which is causing the failure: |
"jest": "^26.6.3", | ||
"jest-puppeteer": "^6.0.1", | ||
"jsdom": "^16.5.0", | ||
"puppeteer": "^10.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benbowler, please, also remove this dep from the main package.json file. And seems like puppeteer-core
is not used anywhere, so we can drop it as well.
"expect-puppeteer": "^4.4.0", | ||
"jest": "^26.6.3", | ||
"jest-puppeteer": "^6.0.1", | ||
"jsdom": "^16.5.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for jsdom
, seems like we can remove it from the main package.json as well.
package.json
Outdated
@@ -184,24 +184,18 @@ | |||
"@testing-library/jest-dom": "^5.16.5", | |||
"@testing-library/react": "^10.4.9", | |||
"@testing-library/react-hooks": "^3.3.0", | |||
"@wordpress/babel-preset-default": "^4.17.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like removing this dependency caused issues in some of the workflows because they somehow depend on it. Probably because we use @wordpress/default
in the babel config 🤔. Let's revert this and add this dependency in the main package.json as well.
Hey @benbowler, as per the sync earlier I've taken a look to revisit the idea of running a dev-installed version of NPM. I noticed there's a bit of a chicken and egg situation when trying to initially install NPM 7 with workspaces configured in This can be resolved, here's a potential approach with a
Hmm, there should only be a single
This case, however seems to be due to patch-package search results
It's worth noting that other script/command dependencies of the root
I can see it's more complicated than I had imagined, but at the same time it seems that some of the issues you've come across are not related to the local/global NPM question. On balance I'm still likely to agree with the conclusion that simply installing the required version globally is the path of least resistance, but I'm interested to get your thoughts on my findings. |
067e649
to
d1a1de7
Compare
Size Change: 0 B Total Size: 2 MB ℹ️ View Unchanged
|
Summary
Addresses issue:
Relevant technical choices
puppeteer
andpuppeteer-core
are used in storybook tests currently, we should remove these from the main package.json as part of #10091.I created a script
install-global-npm
to help developers and the GH actions to install npm v7.PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist