test(coverage): add vitest + pytest coverage with Codecov reporting - #277
Open
winlp4ever wants to merge 1 commit into
Open
test(coverage): add vitest + pytest coverage with Codecov reporting#277winlp4ever wants to merge 1 commit into
winlp4ever wants to merge 1 commit into
Conversation
Wire code coverage for the two unit suites and report it on PRs. - webui: add @vitest/coverage-v8, coverage config in vitest.config.ts, and a test:cov script (v8 provider, text + lcov reporters). - backend: add pytest-cov and [tool.coverage] config (branch coverage, source=topix); emit coverage.xml. - Makefile: test-ui-cov / test-backend-cov targets. - CI: run the suites with coverage and upload to Codecov under per-suite flags (webui, backend); fail_ci_if_error is off so an upload hiccup never blocks a PR. - codecov.yml: informational (non-blocking) statuses + PR diff-coverage comment. Requires a CODECOV_TOKEN repo secret.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds code-coverage measurement to the two unit test suites and reports it on every PR via Codecov.
@vitest/coverage-v8webui/coverage/lcov.infopytest-covbackend/coverage.xmlBaselines from local runs: webui ~27% lines, backend ~55% lines/branch.
Changes
@vitest/coverage-v8dev dep,coverageblock invitest.config.ts(v8 provider,text+lcov),test:covscript.pytest-covdev dep,[tool.coverage.run]/[tool.coverage.report]inpyproject.toml(branch coverage,source=topix).test-ui-cov,test-backend-cov.tests.yml): webui + backend jobs now run the coverage targets and upload to Codecov under per-suite flags (webui,backend).fail_ci_if_error: falseso an upload hiccup never blocks a PR.codecov.yml: statuses are informational (report + comment, never block merges), PR comment shows diff coverage. Tests/e2e are excluded from the denominator.Codecov needs a token for this repo:
vcmf/dim0repo.CODECOV_TOKEN, paste the value.Until the secret exists, the upload steps no-op (they won't fail the build). The tauri/e2e jobs are unaffected.
Notes / follow-ups
informational: true → falseincodecov.ymland set atarget.webui/package-lock.jsonchurn is from@vitest/coverage-v8+ its istanbul/v8 transitive deps only (resolved with npm 11 to avoid an npm-10 solver bug on this tree); no unrelated packages changed.🤖 Generated with Claude Code