-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Display coverage results from bazel coverage
#362
Labels
type: feature request
New feature or request
Comments
vogelsgesang
changed the title
Integrate
Display coverage results from Apr 3, 2024
bazel coverage
supportbazel coverage
vogelsgesang
added a commit
to vogelsgesang/vscode-bazel
that referenced
this issue
Apr 3, 2024
* Add the `bazelTaskInfo` member to the `BazelTaskDefinition` type so it can be accessed in a more typesafe manner. * Merges `bazel_task_info.ts` into `tasks.ts`. Otherwise, adding the `bazelTaskInfo` member would have introduced a cyclical dependency. Also, the `bazel_task_info.ts` was rather small anyway, so keeping this in a separate file didn't provide much value anyway. Refactoring in preparation for bazel-contrib#362
vogelsgesang
added a commit
to vogelsgesang/vscode-bazel
that referenced
this issue
Apr 3, 2024
* Add the `bazelTaskInfo` member to the `BazelTaskDefinition` type so it can be accessed in a more typesafe manner. * Merges `bazel_task_info.ts` into `tasks.ts`. Otherwise, adding the `bazelTaskInfo` member would have introduced a cyclical dependency. Also, the `bazel_task_info.ts` was rather small anyway, so keeping this in a separate file didn't provide much value anyway. Refactoring in preparation for bazel-contrib#362
cameron-martin
pushed a commit
that referenced
this issue
Apr 4, 2024
* Add the `bazelTaskInfo` member to the `BazelTaskDefinition` type so it can be accessed in a more typesafe manner. * Merges `bazel_task_info.ts` into `tasks.ts`. Otherwise, adding the `bazelTaskInfo` member would have introduced a cyclical dependency. Also, the `bazel_task_info.ts` was rather small anyway, so keeping this in a separate file didn't provide much value anyway. Refactoring in preparation for #362
vogelsgesang
added a commit
to vogelsgesang/vscode-bazel
that referenced
this issue
Apr 5, 2024
This commit lays the foundation for displaying coverage results from `bazel coverage`. For the time being, the functionality is only exposed through the user-defined tasks in the `tasks.json`. It is thereby a bit hard to discover. But this is fine for the time being, because coverage still has a couple of rough edges anyway. As soon as it is more stable, we should add builtin commands and expose coverage runs also in the "Bazel Build Target" tree. Changes in this commit: * Bumps the VS Code version to 1.88, i.e. the first VS Code version which supports the test coverage API. * Upgrades to ES2022. I wanted to use `replaceAll` which was introduced in ES2021. VS Code 1.88 is based on Node 18 which in turn is based on V8 10.1. V8 10.18 supports ECMA-262 also known as ES2023. However, ES2023 is not yet available a target language in the `tsconfig.json`. Furthermore, Firefox does not fully support ES2023, yet. While web browsers are currently not relevant, they might become so in the future if we want to turn this into a browser-enabled VSCode extension. An upgrade to ES2021 would have been sufficient, but I went directly to ES2022 because it might some of the other new features might also turn out useful. * Introduces a custom LCOV parser. I could not find any other high-quality open-source parser. E.g., most other parser don't properly parse function names with `:` and / or `,` in them. * Introduces test cases for that custom LCOV parser. Future work: * Support for branch coverage * Demangling of function names * Builtin commands to trigger coverage runs & offer them in the "Bazel Build Tree" Tested with: Java, C++, Go, Rust Untested: Python, Swift, Kotlin, Scala and many more This is the first step towards bazel-contrib#362
vogelsgesang
added a commit
to vogelsgesang/vscode-bazel
that referenced
this issue
Apr 5, 2024
This commit lays the foundation for displaying coverage results from `bazel coverage`. For the time being, the functionality is only exposed through the user-defined tasks in the `tasks.json`. It is thereby a bit hard to discover. But this is fine for the time being, because coverage still has a couple of rough edges anyway. As soon as it is more stable, we should add builtin commands and expose coverage runs also in the "Bazel Build Target" tree. Changes in this commit: * Bumps the VS Code version to 1.88, i.e. the first VS Code version which supports the test coverage API. * Upgrades to ES2022. I wanted to use `replaceAll` which was introduced in ES2021. VS Code 1.88 is based on Node 18 which in turn is based on V8 10.1. V8 10.18 supports ECMA-262 also known as ES2023. However, ES2023 is not yet available a target language in the `tsconfig.json`. Furthermore, Firefox does not fully support ES2023, yet. While web browsers are currently not relevant, they might become so in the future if we want to turn this into a browser-enabled VSCode extension. An upgrade to ES2021 would have been sufficient, but I went directly to ES2022 because it might some of the other new features might also turn out useful. * Introduces a custom LCOV parser. I could not find any other high-quality open-source parser. E.g., most other parser don't properly parse function names with `:` and / or `,` in them. * Introduces test cases for that custom LCOV parser. Future work: * Support for branch coverage * Demangling of function names * Builtin commands to trigger coverage runs & offer them in the "Bazel Build Tree" Tested with: Java, C++, Go, Rust Untested: Python, Swift, Kotlin, Scala and many more This is the first step towards bazel-contrib#362
vogelsgesang
added a commit
to vogelsgesang/vscode-bazel
that referenced
this issue
Apr 5, 2024
This commit lays the foundation for displaying coverage results from `bazel coverage`. For the time being, the functionality is only exposed through the user-defined tasks in the `tasks.json`. It is thereby a bit hard to discover. But this is fine for the time being, because coverage still has a couple of rough edges anyway. As soon as it is more stable, we should add builtin commands and expose coverage runs also in the "Bazel Build Target" tree. Changes in this commit: * Bumps the VS Code version to 1.88, i.e. the first VS Code version which supports the test coverage API. * Upgrades to ES2022. I wanted to use `replaceAll` which was introduced in ES2021. VS Code 1.88 is based on Node 18 which in turn is based on V8 10.1. V8 10.18 supports ECMA-262 also known as ES2023. However, ES2023 is not yet available a target language in the `tsconfig.json`. Furthermore, Firefox does not fully support ES2023, yet. While web browsers are currently not relevant, they might become so in the future if we want to turn this into a browser-enabled VSCode extension. An upgrade to ES2021 would have been sufficient, but I went directly to ES2022 because it might some of the other new features might also turn out useful. * Introduces a custom LCOV parser. I could not find any other high-quality open-source parser. E.g., most other parser don't properly parse function names with `:` and / or `,` in them. * Introduces test cases for that custom LCOV parser. Future work: * Support for branch coverage * Demangling of function names * Builtin commands to trigger coverage runs & offer them in the "Bazel Build Tree" Tested with: Java, C++, Go, Rust Untested: Python, Swift, Kotlin, Scala and many more This is the first step towards bazel-contrib#362
vogelsgesang
added a commit
that referenced
this issue
May 2, 2024
This commit lays the foundation for displaying coverage results from `bazel coverage`. Currently, the functionality is only exposed through the user-defined tasks in the `tasks.json`. It is thereby a bit hard to discover. But this is fine for the time being, because coverage still has a couple of rough edges anyway. As soon as it is more stable, we should add builtin commands and expose coverage runs also in the "Bazel Build Target" tree. Changes in this commit: * Bumps the VS Code version to 1.88, i.e. the first VS Code version which supports the test coverage API. * Upgrades to ES2022. I wanted to use `replaceAll` which was introduced in ES2021. VS Code 1.88 is based on Node 18 which in turn is based on V8 10.1. V8 10.18 supports ECMA-262 also known as ES2023. However, ES2023 is not yet available a target language in the `tsconfig.json`. Furthermore, Firefox does not fully support ES2023, yet. While web browsers are currently not relevant, they might become so in the future if we want to turn this into a browser-enabled VSCode extension. An upgrade to ES2021 would have been sufficient, but I went directly to ES2022 because it might have some of the new features might also turn out useful. * Introduces a custom LCOV parser. I could not find any other high-quality open-source parser. E.g., most other parser don't properly parse function names with `:` and / or `,` in them. * Introduces test cases for that custom LCOV parser. * Add the test cases to GitHub Actions. I followed the instructions from https://code.visualstudio.com/api/working-with-extensions/continuous-integration. Future work: * Support for branch coverage * Demangling of function names * Builtin commands to trigger coverage runs & offer them in the "Bazel Build Tree" Tested with: Java, C++, Go, Rust Untested: Python, Swift, Kotlin, Scala and many more This is the first step towards #362
This was referenced May 2, 2024
cameron-martin
pushed a commit
that referenced
this issue
May 5, 2024
This commit teaches the LCOV parser to also read branch coverage data. Works towards #362
cwahbong
added a commit
to cwahbong/vscode-bazel
that referenced
this issue
Oct 15, 2024
Coverage report generators in Coverage.py would generate BRDA:0 for exit branches: github.com/nedbat/coveragepy/blob/5467e1f/coverage/lcovreport.py#L108-L112 Also small string fixes for error messages in BRDA. Improves bazel-contrib#362.
cwahbong
added a commit
to cwahbong/vscode-bazel
that referenced
this issue
Oct 15, 2024
Coverage report generators in Coverage.py would generate BRDA:0 for exit branches. Ref: https://github.com/nedbat/coveragepy/blob/5467e1f/coverage/lcovreport.py#L108-L112 Also small string fixes for error messages in BRDA. Improves bazel-contrib#362.
cwahbong
added a commit
to cwahbong/vscode-bazel
that referenced
this issue
Oct 15, 2024
Rules under repo local_repository() are external repo but symlinked to a local path, usually in the same workspace. No matter if the local path is in the same workspace, the users should usually want to check the local path specified in local_repository rules instead of the path in bazel output (<bazel workspace>/bazel-<repo>/external/...) in file explorer. Works towards bazel-contrib#416. Imporved bazel-contrib#362.
cwahbong
added a commit
to cwahbong/vscode-bazel
that referenced
this issue
Oct 15, 2024
Rules under repo local_repository() are external repo but symlinked to a local path, usually in the same workspace. No matter if the local path is in the same workspace, the users should usually want to check the local path specified in local_repository rules instead of the path in bazel output (<bazel workspace>/bazel-<repo>/external/...) in file explorer. Works towards bazel-contrib#416. Imporves bazel-contrib#362.
cwahbong
added a commit
to cwahbong/vscode-bazel
that referenced
this issue
Oct 16, 2024
Coverage report generators in Coverage.py would generate BRDA:0 for exit branches. Ref: https://github.com/nedbat/coveragepy/blob/5467e1f/coverage/lcovreport.py#L108-L112 Also small string fixes for error messages in BRDA. Improves bazel-contrib#362.
vogelsgesang
pushed a commit
that referenced
this issue
Oct 16, 2024
Rules under repo local_repository() are external repo but symlinked to a local path, usually in the same workspace. No matter if the local path is in the same workspace, the users should usually want to check the local path specified in local_repository rules instead of the path in bazel output (`<bazel workspace>/bazel-<repo>/external/...`) in the file explorer. Works towards #416. Improves #362.
vogelsgesang
pushed a commit
that referenced
this issue
Oct 16, 2024
Coverage report generators in Coverage.py would generate BRDA:0 for exit branches. Ref: https://github.com/nedbat/coveragepy/blob/5467e1f/coverage/lcovreport.py#L108-L112 Also small string fixes for error messages in BRDA. Improves #362.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VS Code added support for code coverage recently (See microsoft/vscode#123713). It probably makes sense to integrate this with
bazel coverage
, such that the code coverage is directly shown in the IDEtasks.json
feat(coverage): Basic test coverage support #366The text was updated successfully, but these errors were encountered: