wp-cli: Test suite for abstracted command package runs against wrong code
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: https://github.com/wp-cli/cron-command/pull/3
In this example:
bin/install-wp-tests.shdownloadswp-cli-nightly.phpfrom GitHub, for use in the test suite: https://github.com/wp-cli/cron-command/blob/master/bin/install-package-tests.sh#L21wp-cli-nightly.phpincludes a copy ofclass Cron_Commandfrom the point at which the Phar package was built.- Because the nightly’s copy of
class Cron_Commandis autoloaded before the package repository’s copy, the test suite is run againstwp 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.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 32 (32 by maintainers)
Commits related to this issue
- Add scenarios for testing bootstrap loading order. Added scenarios: - `Install a package that overrides a command bundled in source` - `Install a package that overrides a bundled PHAR command` Both ... — committed to wp-cli/wp-cli by schlessera 7 years ago
- Add scenarios for testing bootstrap loading order. Added scenarios: - `Override command bundled with current source` - `Override command bundled with PHAR` Both scenarios are tagged with `@bootstrap... — committed to wp-cli/wp-cli by schlessera 7 years ago
- Add scenarios for testing bootstrap loading order for downloaded PHARs. Added scenarios: - `Override command bundled with downloaded PHAR` - `Install a package that overrides a command from a downloa... — committed to wp-cli/wp-cli by schlessera 7 years ago
- Added scenarios to test Composer stacks and requiring commands as dependencies. Added scenarios: - `Basic Composer stack` - `Composer stack with override requirement after WP-CLI` - `Composer stack w... — committed to wp-cli/wp-cli by schlessera 7 years ago
- Added scenarios to test overriding commands in a Compsoer stack. Added scenarios: - `Override command bundled with Composer stack` - `Install a package that overrides a command from a Composer stack`... — committed to wp-cli/wp-cli by schlessera 7 years ago
- Experimental refactor of the bootstrap process (WIP) The order of execution of the bootstrapping process has been heavily refactored to contain everything in separate, isolated steps as far as curren... — committed to wp-cli/wp-cli by schlessera 7 years ago
- Add autoload splitting logic to split the classes between a "framework" autoloader and a "commands" autoloader. Requires the package `wp-cli/autoload-splitter` that is yet to be created as a reposito... — committed to wp-cli/wp-cli by schlessera 7 years ago
- Make use of the provided custom autoloader. The bootstrap refactoring code did already contain a custom autoloader to get around the fact that the Composer autoloader was not yet active during bootst... — committed to wp-cli/wp-cli by schlessera 7 years ago
It did, yes.
Probably yes, but it’s no longer the
omgwtfbbqblocker for proceeding with #3728 (and actually improving upon the packages).