Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing against other WordPress versions #25

Open
keesiemeijer opened this issue Jun 11, 2017 · 2 comments
Open

Testing against other WordPress versions #25

keesiemeijer opened this issue Jun 11, 2017 · 2 comments

Comments

@keesiemeijer
Copy link

As mentioned in wp-cli/wp-cli#2119 (comment), you can't test against other WP versions than the version in the $WP_CORE_DIR directory. As I see it there are two reasons this exists.

  • To not re-download WordPress again and again when using the install-wp-tests.sh command.
  • For back compatibility with the $WP_CORE_DIR directory.

The $WP_CORE_DIR is an environment variable you can set to use an existing WordPress install for the PHPUnit tests. For back compatibility it's not expected the install-wp-tests.sh command installs other WordPress versions in that directory.

On the other hand when setting a specific $WP_VERSION it is expected you test your plugin against that WP version.

Would it be an Idea to add a flag --force-update to the install-wp-tests.sh command that allows you to update WP regardless if the $WP_CORE_DIR directory already exists?

On an unrelated note we could also convert the skip-database-creation argument to a flag, to not create too many arguments.

@danielbachhuber
Copy link
Member

Would it be an Idea to add a flag --force-update to the install-wp-tests.sh command that allows you to update WP regardless if the $WP_CORE_DIR directory already exists?

How would this be different than running rm $WP_CORE_DIR before install-wp-tests.sh?

@keesiemeijer
Copy link
Author

keesiemeijer commented Jun 11, 2017

I'm using VVV to work on WordPress core. There the $WP_CORE_DIR is set to the wordpress-develop (trunk) directory. In other dev environments I just use the default /tmp/wordpress directory where I don't mind if it's deleted or other WP versions installed.

A problem with deleting is that I would then also have to delete the $WP_TESTS_DIR directory to have install-wp-tests.sh re-install the correct test suite version (and wp-tests-config-sample.php).
I would also have to check if the $WP_CORE_DIR and $WP_TESTS_DIR directories are actually set before deleting.

It would be nice to just re-use the install-wp-tests.sh command to do all this for me and allow me to use specific WP versions where needed.

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

No branches or pull requests

2 participants