codeclimate-action: Failing unit tests does not abort the action
I was wondering why my unit tests seemingly passed, but no coverage report was generated. I noticed in the job logs that my unit tests failed, but the action continued, making it seem that the check passed. But there’s an error that gets ignored:
FAIL
coverage: 48.1% of statements
FAIL 1.210s
FAIL
(node:2733) UnhandledPromiseRejectionWarning: TypeError: (s || "").replace is not a function
at escapeData (/home/runner/work/_actions/paambaati/codeclimate-action/v2.5.3/node_modules/@actions/core/lib/command.js:66:10)
at Command.toString (/home/runner/work/_actions/paambaati/codeclimate-action/v2.5.3/node_modules/@actions/core/lib/command.js:60:35)
at issueCommand (/home/runner/work/_actions/paambaati/codeclimate-action/v2.5.3/node_modules/@actions/core/lib/command.js:23:30)
at Object.issue (/home/runner/work/_actions/paambaati/codeclimate-action/v2.5.3/node_modules/@actions/core/lib/command.js:27:5)
at Object.error (/home/runner/work/_actions/paambaati/codeclimate-action/v2.5.3/node_modules/@actions/core/lib/core.js:120:15)
at /home/runner/work/_actions/paambaati/codeclimate-action/v2.5.3/lib/main.js:89:20
at Generator.throw (<anonymous>)
at rejected (/home/runner/work/_actions/paambaati/codeclimate-action/v2.5.3/lib/main.js:6:65)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2733) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2733) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
See here: https://github.com/ccremer/znapzend-exporter/runs/475913996?check_suite_focus=true
For now, I’ll have to run the unit tests twice I guess, so the job gets properly aborted.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 17 (8 by maintainers)
Commits related to this issue
- main: Pass error message to @actions/core error(). This fixes #119. — committed to paambaati/codeclimate-action by paambaati 4 years ago
- ci: Explicitly add coverage locations so I can debug https://github.com/paambaati/codeclimate-action/issues/119 — committed to paambaati/websight by paambaati 4 years ago
- Revert "ci: Explicitly add coverage locations so I can debug https://github.com/paambaati/codeclimate-action/issues/119" This reverts commit 8214099912e038b9b9a9337ec3a6806d50876e52. Because I think... — committed to paambaati/websight by paambaati 4 years ago
@markkevans @andreipislariu @ccremer @jasonkarns I’ve finally root-caused the issue and fixed it!
Can you folks test
v2.5.7?EDIT: Please hold off on using it as I’m validating it currently again a hobby project of mine.
EDIT 2: Should work now! phew
@jasonkarns can you test something and add the coverageLocations to the github actions workflow file, this fixes the issue for my test repository I think see this example
The 2.5.0 version still has some problems: I don’t get the right Branch name and Commit SHA in CodeClimate, if it is getting triggered by a pull request.
I see the problem with the in 2.5.5, but just the branch name, I still have problems with the commit sha.
If anyone needs a working solution, I moved the test command (with coverage generation) outside of this action in the meantime (in
.goreleasersbefore.hooksto be exactly) and using 2.5.0, which seems to be stable:Unfortunately, still not fixed: https://github.com/ccremer/znapzend-exporter/runs/484538939