Skip to content

Conversation

scottdover
Copy link
Contributor

@scottdover scottdover commented Aug 19, 2025

Summary
This revives @smorrisj's previous work around using c8 for test coverage. This is still a wip

Testing

  • Made sure tests passed w/o failure
  • Made sure what was represented in coverage html is what is expected

Scott Dover added 3 commits August 19, 2025 15:24
"client/src/connection/rest/api",
"server/dist",
"tools",
"server/src/python"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

server/src/python is copied from node_modules as part of the build process

Copy link
Member

Choose a reason for hiding this comment

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

sorry this directory looks not copied from node_modules to me. where did you see the copy?

"**/node_modules/**",
"**/*.test.*",
"client/dist",
"client/src/connection/rest/api",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are files auto-generated by OpenAPI

Comment on lines +15 to +19
"checkCoverage": true,
"lines": 52,
"statements": 52,
"branches": 71,
"functions": 43
Copy link
Contributor Author

@scottdover scottdover Aug 19, 2025

Choose a reason for hiding this comment

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

What do you think about adding minimum levels now just to make sure things don't get worse (the numbers above are right below the current values), with the eventual goal being having code coverage at 80%.

And, do we care about these individual numbers, or do we really only care about lines (I'm inclined to believe this should probably only be "lines": 80)?

Last, is 80% code coverage reasonable in an open source repository, or would that be asking too much from contributors?

Copy link
Member

Choose a reason for hiding this comment

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

I would vote to not fail the build until we're fully ready. I guess we're not setting up testing infrastructure to the webviews. So if lines added in webviews and make the numbers worse it's not straightforward to fix.

@scottdover scottdover marked this pull request as ready for review August 19, 2025 19:59
@scottdover scottdover changed the title feat(wip): add test coverage feat: add test coverage Aug 19, 2025
@scottdover scottdover requested review from scnwwu and smorrisj August 19, 2025 19:59
Copy link
Member

@scnwwu scnwwu left a comment

Choose a reason for hiding this comment

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

A main concern holding the original #93 is that the numbers are not reflecting the real coverage.
For example, I looked at the coverage report from the build
https://github.com/sassoftware/vscode-sas-extension/actions/runs/17080242102/job/48431996872?pr=1606
Looking at client/src/node/extension.ts, most of lines are uncovered, 55-283,285-290.
It doesn't make sense because this file is the entry point. As long as the extension activates, most of the lines should be executed.
Similar to the server/src/server.ts file.
The coverage only counts files directly imported from tests. But some tests require the vscode environment.

"client/src/connection/rest/api",
"server/dist",
"tools",
"server/src/python"
Copy link
Member

Choose a reason for hiding this comment

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

sorry this directory looks not copied from node_modules to me. where did you see the copy?

"src": ["client/src", "server/src"],
"exclude": [
"**/node_modules/**",
"**/*.test.*",
Copy link
Member

Choose a reason for hiding this comment

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

I see client/test in the coverage report. I guess we should exclude it.

Comment on lines +15 to +19
"checkCoverage": true,
"lines": 52,
"statements": 52,
"branches": 71,
"functions": 43
Copy link
Member

Choose a reason for hiding this comment

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

I would vote to not fail the build until we're fully ready. I guess we're not setting up testing infrastructure to the webviews. So if lines added in webviews and make the numbers worse it's not straightforward to fix.

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