Skip to content

Unit Test: WooCommerce 3.3.3 removed webhook factory, breaks Jetpack unit tests #9065

@allendav

Description

@allendav

Steps to reproduce the issue

  • Set up the /tmp/wordpress-develop test environment
  • clone Jetpack into src/wp-content/plugins/jetpack (e.g. today's master)
  • clone WooCommerce into src/wp-content/plugins/woocommerce (e.g. today's master)
  • attempt to run the phpunit tests ala JETPACK_TEST_WOOCOMMERCE=1 phpunit

What I expected

  • Success

What happened instead

PHP Warning:  require_once(/private/tmp/wordpress-develop/src/wp-content/plugins/jetpack/tests/php/sync/../../../../woocommerce/tests/framework/factories/class-wc-unit-test-factory-for-webhook.php): failed to open stream: No such file or directory in /private/tmp/wordpress-develop/src/wp-content/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-woocommerce.php on line 31

Warning: require_once(/private/tmp/wordpress-develop/src/wp-content/plugins/jetpack/tests/php/sync/../../../../woocommerce/tests/framework/factories/class-wc-unit-test-factory-for-webhook.php): failed to open stream: No such file or directory in /private/tmp/wordpress-develop/src/wp-content/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-woocommerce.php on line 31
PHP Fatal error:  require_once(): Failed opening required '/private/tmp/wordpress-develop/src/wp-content/plugins/jetpack/tests/php/sync/../../../../woocommerce/tests/framework/factories/class-wc-unit-test-factory-for-webhook.php' (include_path='.:/Users/allendav/pear/share/pear') in /private/tmp/wordpress-develop/src/wp-content/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-woocommerce.php on line 31

Fatal error: require_once(): Failed opening required '/private/tmp/wordpress-develop/src/wp-content/plugins/jetpack/tests/php/sync/../../../../woocommerce/tests/framework/factories/class-wc-unit-test-factory-for-webhook.php' (include_path='.:/Users/allendav/pear/share/pear') in /private/tmp/wordpress-develop/src/wp-content/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-woocommerce.php on line 31

This is the WooCommerce commit that probably broke Jetpack unit tests: woocommerce/woocommerce@0ac915d

Workaround: checkout woocommerce at a slightly older version, e.g. 3.2.0, that still had the old test directory structure, e.g. https://github.com/woocommerce/woocommerce/releases/tag/3.2.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions