vebr / jest-lcov-reporter Goto Github PK
View Code? Open in Web Editor NEWThis action comments a pull request with a simple HTML test coverage report.
This action comments a pull request with a simple HTML test coverage report.
Hello,
I get the following jest-lcov-reporter error in GitHub Actions:
Run vebr/[email protected]
TypeError: Cannot read property 'head' of undefined
at main$1 (/Users/runner/work/_actions/vebr/jest-lcov-reporter/v0.2.0/dist/main.js:22940:41)
Error: Cannot read property 'head' of undefined
The error did not occur on the branch PR job, but it did occur consistently on the PR merge job to develop.
Publishing the comment fails with the error:
RequestError [HttpError]: Validation Failed: {"resource":"IssueComment","code":"unprocessable","field":"data","message":"Body is too long (maximum is 65536 characters)"}
I found this action and it looked pretty cool, so I tried to run it on a GitHub Enterprise instance, but it failed because it tried to send the report to api.github.com/...
instead of the URL which should be in GITHUB_API_URL
- according to https://docs.github.com/en/actions/reference/environment-variables
Run vebr/[email protected]
RequestError [HttpError]: Bad credentials
at /home/runner/_work/_actions/vebr/jest-lcov-reporter/v0.2.0/dist/main.js:6018:23
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async main$1 (/home/runner/_work/_actions/vebr/jest-lcov-reporter/v0.2.0/dist/main.js:22950:2) {
name: 'HttpError',
status: 401,
headers: {
'access-control-allow-origin': '*',
'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
connection: 'close',
'content-length': '80',
'content-security-policy': "default-src 'none'",
'content-type': 'application/json; charset=utf-8',
date: 'Tue, 02 Feb 2021 10:55:51 GMT',
'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
server: 'GitHub.com',
status: '401 Unauthorized',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
vary: 'Accept-Encoding, Accept, X-Requested-With',
'x-content-type-options': 'nosniff',
'x-frame-options': 'deny',
'x-github-media-type': 'github.v3; format=json',
'x-github-request-id': 'DB6E:35E5:47937F:C53B69:60192FB7',
'x-ratelimit-limit': '60',
'x-ratelimit-remaining': '59',
'x-ratelimit-reset': '1612266951',
'x-ratelimit-used': '1',
'x-xss-protection': '1; mode=block'
},
request: {
method: 'POST',
url: 'api.github.com/repos/telltale/frontend/issues/589/comments',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit.js/16.35.0 Node.js/12.13.1 (Linux 4.19; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8'
},
body: `{"body":"Coverage after merging <b>speed-up-jest-tests</b> into <b>develop</b><table> [TABLE CoNTENT OMMITED for opening THIS GITHUB ISSUE]</table></details>"}`,
request: { hook: [Function: bound bound register], validate: [Object] }
},
documentation_url: 'docs.github.com/rest'
}
Error: Bad credentials
- name: report coverage based on jest
uses: vebr/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
I've changed update-comment a while ago from false into true and the comments even from new PR's are still not updated.
Perhaps this is the same (but opposite) issue as #21
In the readme:
lcov-base (Optional)
The location of the lcov file resulting from running the tests in the base branch. When this is set a diff of the coverage percentages is shown.
How to create this lcov base from the master/main branch? I could create it myself every time and commit it, but i don't think that's a good idee?
Should there be an actions that runs the test every time on the master and store this somehow?
Or should this action also run tests on another branch? is that possible?
I'm trying to use this in a monorepo, where we have a reusable workflow that does the whole checkout
/npm ci
/npm run <command>
etc. shenanigans.
Unfortunately, the update-comment
option doesn't seem to play well with reusable workflows. Looking at the code, it's looking for a comment containing <!-- Code Coverage Comment: <workflow name> -->
. I feel like it should probably use the optional name
input if provided rather than the workflow name, as this means different test suites end up overwriting each other.
I have a workflow with two different jobs which each of them has this GA action.
- name: Publish code coverage report
uses: vebr/[email protected]
with:
github-token: ${{ github.token }}
name: Client Portal Coverage Report
lcov-file: webapps/client-portal/coverage/lcov.info
update-comment: false
- name: Publish code coverage report
uses: vebr/[email protected]
with:
github-token: ${{ github.token }}
name: Qualifications Portal Coverage Report
lcov-file: webapps/qualifications-portal/coverage/lcov.info
update-comment: false
The issue is always there is only one comment created and it's being updated, so I never have the two comments.
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.