Skip to content

Test suite for abstracted command package runs against wrong code #3850

@danielbachhuber

Description

@danielbachhuber

Houston, we have a problem.

When a command is abstracted out to a separate package (#3728), its test suite is incorrectly run against the version of the command included in the current WP-CLI nightly build, not the version of the command in the package repository.

To illustrate, here's a PR that should fail its tests, but doesn't: wp-cli/cron-command#3

In this example:

  • bin/install-wp-tests.sh downloads wp-cli-nightly.php from GitHub, for use in the test suite: https://github.com/wp-cli/cron-command/blob/master/bin/install-package-tests.sh#L21
  • wp-cli-nightly.php includes a copy of class Cron_Command from the point at which the Phar package was built.
  • Because the nightly's copy of class Cron_Command is autoloaded before the package repository's copy, the test suite is run against wp cron * present in the nightly build, not that represented by the code in the repository.

The expectation is that the repository's copy of class Cron_Command is registered over the nightly's copy.

Open to all sorts of creative ideas for how we should address this issue.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions