-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: fix code coverage in github actions #741
Conversation
@@ -10,9 +11,8 @@ module.exports = { | |||
statements: 90, | |||
}, | |||
}, | |||
modulePaths: ['<rootDir>'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't need to make this and the roots
change to get coverage working, we just don't need to set those configs here. rootDir
is good enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omfg 👀 a couple questions just to confirm!
jest.config.js
Outdated
coveragePathIgnorePatterns: ['/dist', '/node_modules'], | ||
coverageDirectory: 'coverage', | ||
coveragePathIgnorePatterns: ['<rootDir>/dist', '<rootDir>/node_modules'], | ||
coverageReporters: ['text-summary'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line required for it to work again or could we bring back the table view?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to text
and it brought back the table view.
You're just going to lose the lcov
reporter that generates the fancy HTML page but I don't know if you ever used that locally or not. https://istanbul.js.org/docs/advanced/alternative-reporters/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥩🥩🥩
🧰 Changes
Code coverage in Github Actions is broken due to Jest, for whatever reason, not automatically creating code coverage directories. I was able to partialy fix this by first creating a
coverage/
directory but even after chmod'ing with 777 permissions it still wouldn't createcoverage/lconv-report/
.As
coverage/lconv-report
has a whole bunch of subdirectories that I have no desire to try to keep up with in a CI workflow, I've just changed our Jest code coverage to use a simpler reporter that dumps to the console.