-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(coverage): Basic test coverage support (#366)
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
- Loading branch information
1 parent
8972b0e
commit 0d293b8
Showing
19 changed files
with
9,351 additions
and
772 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const { defineConfig } = require("@vscode/test-cli"); | ||
|
||
module.exports = defineConfig({ | ||
files: "out/test/**/*.test.js", | ||
mocha: { ui: "bdd" }, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ out/test/** | |
scripts/** | ||
src/** | ||
test/** | ||
.vscode-test/ | ||
|
||
**/*.map | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.