Automattic / Automattic/woocommerce-services

Refactor WCS's test codes that depends on WooCommerce's test libraries

Open
#2,483 0 comments 0 reactions 1 assignee View on GitHub

@iyut is already working on this.

Since Feb 21, 2022.

[Pri] Low [Type] Enhancement [Type] Technical Debt woocommerce-services
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.