Skip to content

testing: enable per-test coverage in the selfhost test provider - #212325

Merged
4 commits merged into
mainfrom
connor4312/212196-2
May 10, 2024
Merged

4 commits merged into
mainfrom
connor4312/212196-2

Conversation

@connor4312

Copy link
Copy Markdown
Member

In this PR, we use the webContents.debugger to take a profile around each individual test to emit V8 incremental coverage each time a test is run. We now handle this manually in the selfhost test provider: we keep each incremental coverage output and also combine it into the overall coverage for the file. A lot of this is munging around with the V8 coverage format.

Also, in learning more about the format, I realized why branches were not always emitted well in c8's data: V8 doesn't actually emit branch information, and it just guesses at where branches are! For simplicity's sake, I don't do any guessing and treat everything as statement coverage.

Later this iteration as the API stabilizes a bit I expect to extract this logic into its own package to be shared between my (and others') various V8-based test runners. Maybe at that point I'll do some smartness to restore branch coverage information based on a AST parsing of the source?

No auto merge here since it requires the next Insiders to work properly.

{
"configurations": [
{
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's needed when debugging the extension?

@connor4312 Connor Peet (connor4312) closed this pull request by merging all changes into main in 1facdf8 May 10, 2024
@connor4312
Connor Peet (connor4312) deleted the connor4312/212196-2 branch May 10, 2024 00:42
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants