WordPress / playground-tools

GNU General Public License v2.0
127 stars 38 forks source link

wp-now: can not run two instances of the same project in parallel #268

Open yotamselementor opened 1 month ago

yotamselementor commented 1 month ago

Main Concept

In order to support test environments & parallel test runs, being able to spin up multiple instances of wp-now would be helpful

Sample Scenario

More details

As far as I could understand, a new argument type should be defined for the CLI (e.g. unique=true) and passed through getWpNowConfig: https://github.com/WordPress/playground-tools/blob/f470bda4d8b7d1214503a9f8891ce4a718226f31/packages/wp-now/src/config.ts#L109 to getWpContentHomePath https://github.com/WordPress/playground-tools/blob/f470bda4d8b7d1214503a9f8891ce4a718226f31/packages/wp-now/src/config.ts#L96 so it could calculate a unique hash for the project. Also, I suppose that the wp-content directory should be deleted after the server has been stopped https://github.com/WordPress/playground-tools/blob/f470bda4d8b7d1214503a9f8891ce4a718226f31/packages/wp-now/src/start-server.ts#L99 https://github.com/WordPress/playground-tools/blob/f470bda4d8b7d1214503a9f8891ce4a718226f31/packages/wp-now/src/run-cli.ts#L116