core icon indicating copy to clipboard operation
core copied to clipboard

Incomplete test coverage makes coverage threshold messages difficult to resolve

Open mcmire opened this issue 1 year ago • 0 comments

There are several packages in this repo that do not have 100% test coverage. In fact we've explicitly set coverage thresholds to match the true coverage today. This makes sense on the surface, but occasionally, a change is made in a PR which causes the coverage to slip below the threshold, which causes a failed build (example: https://github.com/MetaMask/core/actions/runs/9473788927/job/26102151727?pr=4254). These errors are difficult to debug because it is unclear just by looking at the build output where the lack of coverage lies. We need to run yarn test:verbose locally on develop (or the base branch) and then again against the topic branch and manually compare the output visually. This is a pain. It would be great if we didn't need to do this.

Acceptance Criteria

We are able to bring all of the numbers underneath the coverageThreshold portion of the Jest configuration to 100% for the following packages:

  • @metamask/assets-controllers
  • @metamask/base-controller
  • @metamask/controller-utils
  • @metamask/gas-fee-controller
  • @metamask/json-rpc-middleware-stream
  • @metamask/keyring-controller
  • @metamask/network-controller
  • @metamask/polling-controller
  • @metamask/preferences-controller
  • @metamask/profile-sync-controller
  • @metamask/rate-limit-controller
  • @metamask/transaction-controller

mcmire avatar Jun 11 '24 22:06 mcmire