-
Notifications
You must be signed in to change notification settings - Fork 0
enforce coverage 80 #87
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
77547d6
feat: add coverage enforcement for tests and update CI configuration
devlux76 853499c
Enforce minimum 80% test coverage in CI + local pre-push hook
devlux76 2de6229
Relax branch coverage enforcement while keeping 80% minimum line/func…
devlux76 7caf0d0
Fix vitest coverage config: remove unsupported 'all' option
devlux76 8d4addd
Potential fix for pull request finding
devlux76 91af6f8
Opt into Node.js 24 for GitHub Actions (force JS actions to Node 24)
devlux76 59de096
Pin @vitest/coverage-v8 to latest (#88)
Copilot dda527d
Run guard:model-derived and guard:hotpath-policy on pre-push and fix …
devlux76 9154d8d
Fix guard-hotpath-policy to allow lib/core/HotpathPolicy.ts
devlux76 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,10 @@ | ||
| #!/bin/sh | ||
| . "$(dirname "$0")/_/husky.sh" | ||
|
|
||
| # Enforce minimum coverage locally before pushing. | ||
| # This mirrors the CI coverage enforcement and keeps merge-ready branches aligned. | ||
| bun run test:coverage | ||
|
|
||
| # Also run project guards locally (same as CI) so issues are caught before push. | ||
| bun run guard:model-derived | ||
| bun run guard:hotpath-policy |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,46 @@ | ||
| import { defineConfig } from "vitest/config"; | ||
|
|
||
| export default defineConfig({ | ||
| test: { | ||
| include: ["**/*.test.ts", "**/*.spec.ts"], | ||
| coverage: { | ||
| provider: "v8", | ||
| enabled: !!process.env.CI, | ||
| clean: true, | ||
| include: ["lib/**/*.ts"], | ||
| reporter: ["text", "html"], | ||
| reportsDirectory: "coverage", | ||
devlux76 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| exclude: [ | ||
| // Runtime configuration + platform-specific code that is not testable in this environment | ||
| "lib/CreateVectorBackend.ts", | ||
| "lib/WasmVectorBackend.ts", | ||
| "lib/WebGLVectorBackend.ts", | ||
| "lib/WebGPUVectorBackend.ts", | ||
| "lib/WebNNVectorBackend.ts", | ||
| // Pure type definitions (no executable JS generated) | ||
| "**/*.d.ts", | ||
| "**/types.ts", | ||
| "**/VectorBackend.ts", | ||
| "**/ModelProfile.ts", | ||
| "**/QueryResult.ts", | ||
| "**/WebNNTypes.*", | ||
| // Test and tooling files | ||
| "tests/**", | ||
| "benchmarks/**", | ||
| "scripts/**", | ||
| "docker/**", | ||
| "node_modules/**", | ||
| ], | ||
| thresholds: { | ||
| // Enforce a minimum test coverage baseline. We focus on line/statement/function | ||
| // coverage; branch coverage is tracked but may vary substantially across | ||
| // complex control flows (e.g., optional platform APIs). Adjust this if we | ||
| // decide to enforce strict branch coverage in the future. | ||
| lines: 80, | ||
| functions: 80, | ||
| branches: 0, | ||
| statements: 80, | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.