-
Notifications
You must be signed in to change notification settings - Fork 180
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
(TFECO-8268) Enable code coverage reporting #1901
base: main
Are you sure you want to change the base?
Conversation
This commit enables code coverage reporting for the integration test suites. It uses the `vscode-test` extension's built-in code coverage reporting feature to generate coverage reports for the test suites.
Previously if you were to run `npm run compile` or `npm test`, you would be executing `npm run check-types`, then `npm run lint`, and finally `node esbuild.mjs` or `vscode-test`, respectively, every time you wanted to compile or test the code. This duplication added several seconds to the build or test time. This was unecessary when running interactively, and even more so in CI where these steps were repeated multiple times. This change reduces the number of duplicate steps in CI by running type checking, linting, and formatting only once before compiling or running tests. It also results in a faster run time interactively because we aren't running the more intensive type checking every time. This becomes more important as we added UI testing to the CI pipeline, which is a more intensive process than the other steps.
2960db8
to
4de790f
Compare
.vscode-test.mjs
Outdated
thresholds: { | ||
global: { | ||
statements: 80, | ||
branches: 80, | ||
functions: 80, | ||
lines: 80, | ||
}, | ||
}, |
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.
thresholds: { | |
global: { | |
statements: 80, | |
branches: 80, | |
functions: 80, | |
lines: 80, | |
}, | |
}, |
I couldn't find anything about thresholds
in the types or the vscode-test(-cli) repositories. Are you sure that having them here is does anything? Otherwise I would like to remove them to avoid confusion.
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'm not a code coverage expert, but I play one on TV.
The vscode-test cli doesn't provide the code coverage tooling, mocha provides general code coverage with the ability for other libraries to expand/extend on them.
The thresholds are from when I was trying to get the [nyc[(https://github.com/istanbuljs/nyc) tool to work, but the return on the amount of time required to get it working was not beneficial. I opted to keep the builtin coverage, but neglected to remove the thresholds object. If we were to use another library, options like these would fail the build if they were not met
Co-authored-by: Daniel Banck <[email protected]>
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.
Great work! Thanks for splitting up the steps in CI to make things faster.
This enables code coverage reporting for the integration test suites. It uses the
vscode-test
extension's built-in code coverage reporting feature to generate coverage reports for the test suites.Previously if you were to run
npm run compile
ornpm test
, you would be executingnpm run check-types
, thennpm run lint
, and finallynode esbuild.mjs
orvscode-test
, respectively, every time you wanted to compile or test the code. This duplication added several seconds to the build or test time. This was unecessary when running interactively, and even more so in CI where these steps were repeated multiple times.This also reduces the number of duplicate steps in CI by running type checking, linting, and formatting only once before compiling or running tests. It also results in a faster run time interactively because we aren't running the more intensive type checking every time.
This becomes more important as we added UI testing to the CI pipeline, which is a more intensive process than the other steps.