Skip to content

Coverage in CI Pipeline#4168

Draft
MicahMaphet wants to merge 8 commits into
bitpay:masterfrom
MicahMaphet:ci-coverage
Draft

Coverage in CI Pipeline#4168
MicahMaphet wants to merge 8 commits into
bitpay:masterfrom
MicahMaphet:ci-coverage

Conversation

@MicahMaphet
Copy link
Copy Markdown
Contributor

@MicahMaphet MicahMaphet commented May 15, 2026

Description 🧪

Added coverage with minimum thresholds to the Circle CI tests. Now, if a test doesn't run a certain amount of code, the test will fail in Circle CI. Each test for each package has a threshold for, statements, branches, functions and lines of code. I determined the thresholds by rounding down from what they are currently at. The goal is to prevent coverage from regressing.

Changelog 🪵

  • Add coverage scripts for each package in bitcore/package.json so they can be run in CircleCI + cleanup (removed a lot of commands). @kajoseph Make sure I didn't remove anything needed and let me know if I should remove more.
  • Use bitcore/package.json coverage scripts instead of test scripts in .circleci/config.yml + cleanup
  • Changed thresholds to be rounded down to the nearest 10 from where it currently scores, e.g. when I run npm run coverage in say bitcore-wallet-service and the statement coverage is 68, round to 60, branches coverage is 53, rond to 50 etc.
  • Coverage check for bitcore-build, which adds coverage to all JavaScript packages except bitcore-tss
  • Added bitcore-logging to CircleCI with new coverage check
  • Coverage check to bitcore-tss in nyc config
  • Increased timeout for the NEW bitcore-cli NEW tests as nyc slowed it down causing the create command test to overrun
  • Removed tsx from everything but bitcore-client because otherwise it breaks

Testing Notes 📺

Run all of the coverage tests:

npm run coverage:<package name>

Checklist

image confirming that coverage works in CircleCI another image confirming that coverage works in CircleCI
  • Coverage check for crypto-rpc
  • Use nyc for all packages
  • Install nyc in bitcore/node_modules

Proposal

Don't distinguish between coverage and test. Just have all our tests check coverage.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant