ci(web-clipper): enforce coverage and upload it to Codecov

The web clipper's specs ran in dev.yml's catch-all "Run the rest of the
tests" step without --coverage, so nothing measured or gated coverage
and nothing reached Codecov.

The suite now has its own step with --coverage, followed by the coverage
and test-result uploads under a `web-clipper` flag, mirroring commons;
the catch-all step excludes it so it runs once. codecov.yml gains the
flag with carryforward.

vitest.config.mts sets thresholds of 95% for lines, statements and
functions and 90% for branches, a few points under the 97.6/97.7/98.6/
93.7% the suite reaches now that the popup and options pages are in
Preact and tested. The lcov reporter's projectRoot is pinned to the
repo root, as every other suite does, so `SF:` paths are unambiguous
across the monorepo.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Elian Doran
2026-10-10 21:59:08 +03:00
co-authored by Claude Opus 5.5
parent 417d571fac
commit 714b13239c
3 changed files with 39 additions and 2 deletions
+25 -1
View File
@@ -199,6 +199,30 @@ jobs:
disable_search: true
fail_ci_if_error: false
- name: Run the web clipper tests
id: test-web-clipper
run: pnpm run --filter=web-clipper test --coverage
- name: Upload web clipper coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
if: ${{ !cancelled() && steps.test-web-clipper.outcome == 'success' }}
with:
files: apps/web-clipper/test-output/vitest/coverage/lcov.info
flags: web-clipper
disable_search: true
fail_ci_if_error: false
- name: Upload web clipper test results to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
if: ${{ !cancelled() && steps.test-web-clipper.outcome != 'skipped' }}
with:
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
files: apps/web-clipper/test-output/vitest/junit.xml
flags: web-clipper
disable_search: true
fail_ci_if_error: false
- name: Run the codemirror tests
id: test-codemirror
run: pnpm run --filter=codemirror test --coverage
@@ -296,7 +320,7 @@ jobs:
fail_ci_if_error: false
- name: Run the rest of the tests
run: pnpm run --filter=\!client --filter=\!standalone --filter=\!server --filter=\!desktop --filter=\!commons --filter=\!ckeditor5 --filter=\!codemirror --filter=\!highlightjs --filter=\!pdfjs-viewer --filter=\!share-theme test
run: pnpm run --filter=\!client --filter=\!standalone --filter=\!server --filter=\!desktop --filter=\!commons --filter=\!web-clipper --filter=\!ckeditor5 --filter=\!codemirror --filter=\!highlightjs --filter=\!pdfjs-viewer --filter=\!share-theme test
# The two suites below are split out of test_dev so they run concurrently with
# it (and each other) rather than queueing behind the client/package suites.
+9 -1
View File
@@ -21,7 +21,15 @@ export default defineConfig({
provider: "v8" as const,
include: [ "entrypoints/**/*.{ts,tsx}", "utils.ts" ],
exclude: [ "**/*.{test,spec}.{ts,tsx}", "**/*.d.ts" ],
reporter: [ "text", "lcov" ]
// Repo-root-relative `SF:` paths, so Codecov does not match a bare `utils.ts` or
// `entrypoints/…/index.ts` to another project of the monorepo.
reporter: [ "text", [ "lcov", { projectRoot: join(import.meta.dirname, "../..") } ] ],
thresholds: {
lines: 95,
statements: 95,
functions: 95,
branches: 90
}
}
}
});
+5
View File
@@ -66,6 +66,11 @@ flags:
paths:
- packages/share-theme/src/
carryforward: true
web-clipper:
paths:
- apps/web-clipper/entrypoints/
- apps/web-clipper/utils.ts
carryforward: true
comment:
layout: "condensed_header, condensed_files, condensed_footer"