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

Create npm workspace for E2E tests #10119

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

benbowler
Copy link
Collaborator

@benbowler benbowler commented Jan 27, 2025

Summary

Addresses issue:

Relevant technical choices

puppeteer and puppeteer-core are used in storybook tests currently, we should remove these from the main package.json as part of #10091.

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

Copy link

github-actions bot commented Jan 27, 2025

Build files for 60b77c2 are ready:

@benbowler
Copy link
Collaborator Author

Note the one failing E2E test will be fixed in #10111

@benbowler benbowler changed the title Infrastructure/10013-npm-workspaces-e2e Create npm workspace for E2E tests Jan 28, 2025
Copy link
Collaborator

@eugene-manuilov eugene-manuilov left a 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.

Comment on lines +6 to +9
"devDependencies": {
"expect-puppeteer": "^4.4.0",
"jest-puppeteer": "^4.4.0"
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to define all dependencies that are used by e2e tests here, even if they are still used by other parts as well, in which case we shouldn't remove them from the main package.json.

Here is the full list of dependencies that should be here:

{
	"dependencies": {
		"@wordpress/babel-preset-default": "^4.20.0",
		"@wordpress/e2e-test-utils": "^4.16.1",
		"@wordpress/jest-console": "^3.10.0",
		"amphtml-validator": "^1.0.38",
		"babel-jest": "^26.6.3",
		"dockerode": "^4.0.2",
		"expect-puppeteer": "^4.4.0",
		"jest": "^26.6.3",
		"jest-puppeteer": "^4.4.0",
		"jsdom": "^16.7.0",
		"puppeteer": "^10.4.0"
	}
}

Comment on lines +2 to +5
"name": "googlesitekit-e2e",
"description": "E2E testing infrastructure for Google Site Kit",
"main": "script.js",
"private": true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not needed, we can remove it.

Suggested change
"name": "googlesitekit-e2e",
"description": "E2E testing infrastructure for Google Site Kit",
"main": "script.js",
"private": true,

Comment on lines +20 to +29
"repository": {
"type": "git",
"url": "git+https://github.com/google/site-kit-wp.git"
},
"author": "Google",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/google/site-kit-wp/issues"
},
"homepage": "https://github.com/google/site-kit-wp#readme"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same, not needed.

Suggested change
"repository": {
"type": "git",
"url": "git+https://github.com/google/site-kit-wp.git"
},
"author": "Google",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/google/site-kit-wp/issues"
},
"homepage": "https://github.com/google/site-kit-wp#readme"

Comment on lines +16 to +18
"env:start": "./../../bin/local-env/start.sh",
"env:stop": "./../../bin/local-env/stop.sh",
"env:reset-site": "./../../bin/local-env/install-wordpress.sh --reset-site"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should also move local-env files into the tests/e2e folder? We don't use it anywhere else, right?

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.

2 participants