-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
PoC: Run E2E tests with WP Playground #62692
base: trunk
Are you sure you want to change the base?
Conversation
26f785c
to
f60c136
Compare
f60c136
to
5416734
Compare
@adamziel, many tests are failing because the database randomly disconnects, causing the app to throw 500 errors. I have yet to find a consistent way to reproduce the issue, but I'll continue working on it when I'm back (around July 2nd). Once this issue is resolved, the legit failures will provide valuable information on Playground's current limitations compared to wp-env. It's been nice to see how easy it is to circumvent wp-env. Spinning up the WP Playground instance is really fast, too. 💪 cc: @griffbrad @dmsnell |
FWIW for https://github.com/swissspidy/media-experiments I always use wp-now for running tests locally (as I can't use Docker) and I constantly run into the same issue with 500 errors. Curious to hear what you find out. |
|
||
# Install the dependencies | ||
cd playground | ||
npm install |
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.
I know this keeps the Playground updated, but the build artifact from the Playground should be an executable you can download and run directly. That would surely skip a lot of runtime and build steps.
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.
Would that simply be https://www.npmjs.com/package/@wp-playground/cli?
npm run wp-env start | ||
cd playground | ||
~/.bun/bin/bun packages/playground/cli/src/cli.ts server \ | ||
--wp=6.5 \ |
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.
would it be preferable to use nightly
here?
@WunderBart @swissspidy are you using a MySQL connection or relying on SQLite when you get the 500s? How do we know it's a database disconnect? I didn't think that is possible with SQLite, and I wonder also if we're seeing concurrency issues with multiple requests? Mostly the Playground handles requests serially, but I think it should be fine with concurrent requests as well. |
Hmm I don't think it's a database issue in my case. Also no idea how to make it use MySQL, so I think it's just the default SQLite setup. Just did another test and it's actually more a timeout than a proper error 500. The server stops responding and in the terminal I get errors like this:
But I don't wanna hijack the discussion here :-) |
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
What?
A simple PoC for running E2E tests against a Playground instance (circumventing wp-env entirely).
How?
Playground part
Clone WP Playground and install deps:
git clone -b trunk --single-branch --depth 1 git@github.com:WordPress/wordpress-playground.git cd wordpress-playground npm install
Run the following CLI command to start the Playground server:
Note the server URL. By default it's
http://127.0.0.1:9400
.Gutenberg part
Run
npm run build
to build the local Gutenberg.Assign the Playground server via
WP_BASE_URL
and run the tests as usual. For example:No
wp-env
, no Docker. Profit?