-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve coverage transparency (#612)
* chore: remove default coverage file * chore: remove c8 comments * chore: add build for dynamic coverage * chore: fix windows and mac * docs: add coverage disclaimer * chore: few adjustments * ci: restaure defineConfigs test * chore: ensure clean build * docs: update link to coverage discussion
- Loading branch information
1 parent
cf22b0a
commit 219f075
Showing
23 changed files
with
204 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ node_modules | |
/test-src | ||
/test-tests | ||
/test-before-and-after-each.json | ||
.nycrc.json |
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,34 @@ | ||
# ☔️ Coverage | ||
|
||
## Specific cases and approaches don't generate coverage reports properly | ||
|
||
### Different behaviors due to platform versions | ||
|
||
- Compatibility with `c8` starts with [**Node.js** `v18`](https://github.com/bcoe/c8/blob/ff146b4dde004c62651b57c33cedd8353c94c423/package.json#L67). | ||
- Compatibility with `monocart-coverage-reports` starts with [**Node.js** `v18`](https://github.com/cenfun/monocart-coverage-reports/issues/60). | ||
|
||
### Different behaviors due to **Deno** and **Bun** platforms | ||
|
||
- At the moment, there is no way to generate the coverage report for them using `c8` or `monocart-coverage-reports`. | ||
|
||
### process-based | ||
|
||
> E.g., `process.on`, `process.once`, `pid`, etc. | ||
- I intend to do more research. | ||
|
||
--- | ||
|
||
### Conclusion | ||
|
||
The choice not to consider these topics in the coverage comes from the fact that it isn't possible, not that they are ignored. For example, even if exhaustive tests are created for **Node.js** `v8`, there is no way to generate the coverage report for these tests. | ||
|
||
> Similarly, there are specific tests for **Bun** and **Deno** that don't generate coverage reports. | ||
- In order to keep the minimum possible number of coverage instructions within the code, I have concentrated the cases of impossible coverage in individual files. | ||
|
||
> [!NOTE] | ||
> | ||
> If you don't agree with any of these not covered topics, please feel free to comment. I'm totally open to discussions and opinions. | ||
> | ||
> - In disagreements, please see and discuss through [discussion#613](https://github.com/wellwelwel/poku/discussions/613). |
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,19 @@ | ||
/** | ||
* Global setttings | ||
* | ||
* The final compatibility file is generated by merging this file with the file based on the current operating system. | ||
* You can see the compilation process at: ./tools/biuld/c8-file.ts and generate it by running `npm run pretest:c8`, then check the generated file at ./.nycrc.json. | ||
*/ | ||
{ | ||
"clean": true, | ||
"all": true, | ||
"include": ["src/**"], | ||
"reporter": ["v8", "codecov", "console-details"], | ||
"branches": 95, | ||
"statements": 95, | ||
"lines": 95, | ||
"functions": 95, | ||
"checkCoverage": true, | ||
"import": ["tsx"], | ||
"extension": [".ts"] | ||
} |
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,21 @@ | ||
/** | ||
* Global setttings | ||
* | ||
* In addition to the ./README.md in this directory, each deleted file explains the reason for its deletion. | ||
* Please note that excluded files aren't ignored, but that the coverage report can't be properly generated. | ||
*/ | ||
{ | ||
"exclude": [ | ||
"src/@types", // Typings exports only | ||
"src/polyfills", // They involve compatibility between older versions of platforms or assist in cross-platform compatibility | ||
"src/modules/helpers/create-service.ts", // Varies of platform (Node.js, Bun, and Deno) | ||
"src/modules/helpers/container.ts", // On macOS, the memory consumption and installation time plus the processing required cause constant failures due to timeouts or resource limit usage. | ||
"src/modules/helpers/get-pids.ts", // 100% Process-based | ||
"src/modules/helpers/kill.ts", // 100% Process-based | ||
"src/services/container.ts", // On macOS, the memory consumption and installation time plus the processing required cause constant failures due to timeouts or resource limit usage. | ||
"src/parsers/get-runner.ts", // Varies of platform (npm, yarn, bun, deno, pnpm, etc.) | ||
"src/parsers/get-runtime.ts", // Varies of platform (Node.js, Bun, and Deno) | ||
"src/services/pid.ts", // 100% Process-based | ||
"src/bin" // TODO: Remove after expose `inpectCLI` and `watchCLI` methods. | ||
] | ||
} |
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,19 @@ | ||
/** | ||
* Global setttings | ||
* | ||
* In addition to the ./README.md in this directory, each deleted file explains the reason for its deletion. | ||
* Please note that excluded files aren't ignored, but that the coverage report can't be properly generated. | ||
*/ | ||
{ | ||
"exclude": [ | ||
"src/@types", // Typings exports only | ||
"src/polyfills", // They involve compatibility between older versions of platforms or assist in cross-platform compatibility | ||
"src/modules/helpers/create-service.ts", // Varies of platform (Node.js, Bun, and Deno) | ||
"src/modules/helpers/get-pids.ts", // 100% Process-based | ||
"src/modules/helpers/kill.ts", // 100% Process-based | ||
"src/parsers/get-runner.ts", // Varies of platform (Node.js, Bun, and Deno) | ||
"src/parsers/get-runtime.ts", // Varies of platform (Node.js, Bun, and Deno) | ||
"src/services/pid.ts", // 100% Process-based | ||
"src/bin" // TODO: Remove after expose `inpectCLI` and `watchCLI` methods. | ||
] | ||
} |
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,21 @@ | ||
/** | ||
* Global setttings | ||
* | ||
* In addition to the ./README.md in this directory, each deleted file explains the reason for its deletion. | ||
* Please note that excluded files aren't ignored, but that the coverage report can't be properly generated. | ||
*/ | ||
{ | ||
"exclude": [ | ||
"src/@types", // Typings exports only | ||
"src/polyfills", // They involve compatibility between older versions of platforms or assist in cross-platform compatibility | ||
"src/modules/helpers/create-service.ts", // Varies of platform (Node.js, Bun, and Deno) | ||
"src/modules/helpers/container.ts", // On Windows-based GitHub Actions, it's not possible to pull images based on manifest windows/amd64 | ||
"src/modules/helpers/get-pids.ts", // 100% Process-based | ||
"src/modules/helpers/kill.ts", // 100% Process-based | ||
"src/services/container.ts", // On Windows-based GitHub Actions, it's not possible to pull images based on manifest windows/amd64 | ||
"src/parsers/get-runner.ts", // Varies of platform (Node.js, Bun, and Deno) | ||
"src/parsers/get-runtime.ts", // Varies of platform (Node.js, Bun, and Deno) | ||
"src/services/pid.ts", // 100% Process-based | ||
"src/bin" // TODO: Remove after expose `inpectCLI` and `watchCLI` methods. | ||
] | ||
} |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/CHANGELOG.md | ||
/website | ||
/fixtures/sintax | ||
/.nycrc.json |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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.