Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Dec 5, 2024

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 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 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.

@jpogran jpogran self-assigned this Dec 5, 2024
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.
@jpogran jpogran force-pushed the enable_code_coverage branch from 2960db8 to 4de790f Compare December 9, 2024 20:25
@jpogran jpogran changed the title enable code coverage (TFECO-8268) Enable code coverage reporting Dec 9, 2024
@jpogran jpogran marked this pull request as ready for review December 9, 2024 20:31
@jpogran jpogran requested a review from a team as a code owner December 9, 2024 20:31
.vscode-test.mjs Outdated
Comment on lines 38 to 45
thresholds: {
global: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor Author

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]>
Copy link
Member

@dbanck dbanck left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants