RTC: Add command to run in WebSockets mode#78363
Conversation
|
Size Change: 0 B Total Size: 7.97 MB ℹ️ View Unchanged
|
|
Flaky tests detected in e83c090. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25935610635
|
|
Should we move the script out of |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@maxschmeling Where do you think it should live, maybe in the root |
|
@maxschmeling Actually, I think living in |
What?
Since #78179 we've had the ability to run tests against a local WebSocket provider. WebSocket tests are not part of CI runs yet, but that's the plan in the near future. Add root-level commands to run
wp-envwith RTC in WebSocket or HTTP mode:Why?
The e2e WebSocket harness already exists using an official
@y/websocket-serverimplementation. But there's no local dev path to test RTC over WebSockets manually because there are a few manual steps necessary:.wp-env.jsonto mount the test pluginHow?
This PR adds commands to run those steps with
npm run rtc:ws(in/test/e2e/bin/rtc-dev.mjs), andnpm run rtc:httpto revert the local changes. Note thatrtc:wsalso runs the WebSockets server, where asrtc:httpreverts to the defaults and does not require a separate running sync server.Testing Instructions
To enable WebSockets, run
npm run rtc:ws, then load a post!ws-enable.mov
To disable (revert to default), run
npm run rtc:httpand reload a post:http-enable.mov
Note I've marked this as "Automated Testing" because I plan to use this feature to diagnose WebSockets-related issues #77924, so we can get WebSocket code under automated testing.