Automattic / Automattic/woocommerce-services
Refactor WCS's test codes that depends on WooCommerce's test libraries
@iyut is already working on this.
Since Feb 21, 2022.
- Dominant language
- JavaScript
- Stars
- 112
- Forks
- 35
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 14
Description
Description
WCS&T uses includes WooCommerce core's test library 'tests/legacy/bootstrap.php' in our PHPUnit bootstrap file. One example why we need this is the use of WC_REST_Unit_Test_Case (link).
In our pipeline, we first install composer for WCS. WCS has a dependency for PHPUnit.
Then, we Setup WordPress and WooCommerce to run the test. This step, however, also installs PHPUnit for WooCommerce. As a result, during pipeline tests, there is a chance that WooCommerce core runs a different PHPUnit version than WCS', creating this problem.
Problem
Find a way to improve/refactor the PHPUnit dependency here so that we won't run into this problem again when WC changes its PHPUnit version. We can also explore improving how we are bootstrapping our tests.
Relates
https://github.com/Automattic/woocommerce-services/pull/2482
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.