bahmutov / check-code-coverage Goto Github PK
View Code? Open in Web Editor NEWUtilities for checking the coverage produced by NYC against extra or missing files
Utilities for checking the coverage produced by NYC against extra or missing files
Above 90 - bright green
80 - 90 - green
60 - 80 - yellow
less than 60 - red
The token is definitely being passed in, but for whatever reason isn't being found.
Ensure coverage has not dropped ๐4s
GITHUB_TOKEN: ***
Run DEBUG=check-code-coverage npx set-gh-status --check-against-readme
DEBUG=check-code-coverage npx set-gh-status --check-against-readme
shell: /bin/bash -e {0}
env:
GITHUB_TOKEN: ***
npx: installed 69 in 3.549s
Token must be provided!
##[error]Process completed with exit code 1.
It looks like this package assumes everything is at the root folder. After adding cd clients/html &&
to the npx line, it works, but then it's looking for the badge at the root-level README
which doesn't have a badge.
Current README:
![check-code-coverage](https://img.shields.io/badge/code--coverage-92.9%25-brightgreen)
![Master](https://github.com/dchbx/enroll-ui/workflows/Test,%20Lint,%20Build/badge.svg?branch=master)
Run DEBUG=check-code-coverage npx update-badge --from /Users/markgoho/Projects/enroll-ui/apps/admin-e2e/coverage/coverage-summary.json
check-code-coverage args: { _: [], '--from': '/Users/markgoho/Projects/enroll-ui/apps/admin-e2e/coverage/coverage-summary.json' } +0ms
check-code-coverage reading coverage from { filename: '/Users/markgoho/Projects/enroll-ui/apps/admin-e2e/coverage/coverage-summary.json' } +0ms
check-code-coverage reading coverage summary from: /Users/markgoho/Projects/enroll-ui/apps/admin-e2e/coverage/coverage-summary.json +0ms
check-code-coverage clamped coverage: 92.9 +3ms
check-code-coverage coverage regex: "/https:\/\/img\.shields\.io\/badge\/code--coverage-\d+%25-(:?red|yellow|green|brightgreen)/" +1ms
check-code-coverage for coverage 92.9% badge color "brightgreen" +1ms
check-code-coverage new coverage badge: "https://img.shields.io/badge/code--coverage-92.9%25-brightgreen" +0ms
โ ๏ธ Could not find code coverage badge in file /Users/markgoho/Projects/enroll-ui/README.md
Insert new badge on the first line
check-code-coverage inserting new badge: ![check-code-coverage](https://img.shields.io/badge/code--coverage-92.9%25-brightgreen) +0ms
saving updated readme with coverage 92.9%
Updated README:
![check-code-coverage](https://img.shields.io/badge/code--coverage-92.9%25-brightgreen) ![check-code-coverage](https://img.shields.io/badge/code--coverage-92.9%25-brightgreen)
![Master](https://github.com/dchbx/enroll-ui/workflows/Test,%20Lint,%20Build/badge.svg?branch=master)
P.S. โค๏ธ the debugging, it helps so much!
There is a package called set-gh-status in NPM registry, so using npx set-gh-startus
will not work as expected, the correct snippet is:
- name: Set code coverage commit status ๐ซ
run: npx -p check-code-coverage set-gh-status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
I will make a pull request to fix these errors.
Marks-MacBook-Pro:enroll-ui markgoho$ DEBUG=check-code-coverage npx update-badge --from apps/admin-e2e/coverage/coverage-summary.json
check-code-coverage args: { _: [], '--from': 'apps/admin-e2e/coverage/coverage-summary.json' } +0ms
check-code-coverage reading coverage from { filename: 'apps/admin-e2e/coverage/coverage-summary.json' } +0ms
check-code-coverage reading coverage summary from: apps/admin-e2e/coverage/coverage-summary.json +1ms
Cannot find module 'apps/admin-e2e/coverage/coverage-summary.json'
Require stack:
- /Users/markgoho/Projects/enroll-ui/node_modules/check-code-coverage/src/index.js
- /Users/markgoho/Projects/enroll-ui/node_modules/check-code-coverage/bin/update-badge.js
Is npx
doing something weird?
From https://github.com/bahmutov/check-code-coverage - probably using statements
By default should be .nyc_output
, but could be any other file, like coverage/coverage-final.json
for example
To check multiple files at once
To not read it from a file, but to set it to a specific number between 0 and 100
Probably in the first line of the README
We are looking for a hacky way to fail a CI job based bash output.
โ
Total statement coverage 95.68% is >= minimum 95%
If we do not see a โ , fail the job. Is this possible?
Extend check-total
to look beyond statements. It appears, at the moment, check-total only checks against statements and not against lines, functions or branches
.
check-total --from coverage/coverage-summary.json --min 80
Also support
check-total --from coverage/coverage-summary.json --min 80 --functions 63 --branches 53
Which would check against lines, functions and branches as well.
Additionally, if .nycrc
is present then it can read the thresholds if not provided on cli.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/ci.yml
actions/checkout v3
bahmutov/npm-install v1
cycjimmy/semantic-release-action v3
package.json
arg 4.1.3
debug 4.3.4
got 11.8.6
lodash 4.17.21
ava 3.15.0
prettier 2.8.8
semantic-release 18.0.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.