Skip to content

Create several sites in one step #379

Closed as not planned
Closed as not planned

Description

@schlessera

Multisite scenarios often create their sites one at a time with wp site create before the actual test, for example in site.feature in entity-command, core-update-db.feature in core-command and cli-bash-completion.feature in wp-cli. Each site takes about 0.7 seconds to create, and this happens about 65 times per suite run.

A step that creates a list of sites at once, saving their IDs where needed, would make this setup cheaper and easier to read.

Activity

  1. schlessera commented on Oct 31, 2026

    @schlessera
    MemberAuthor

    Measured in #407 against the test suites of 4 bundled commands, with three runs with and without the change each (see the pull request description for the numbers).

    Only about 45 sites are created this way across the bundled commands, so the total Behat time changed by +1.9%, within the run-to-run variation. Creating the sites in a single process also broke three core update-db scenarios in core-command that first downgrade WordPress to 5.4, failing with Table 'wp_cli_test.wp_2_posts' doesn't exist, while separate wp site create calls work.

    Closing, as there is no measurable gain and creating sites in a single process is not reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions