From 6f689920b4254b2121b75448b1b8341d340b6ef3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 13 Jun 2026 14:54:37 +0300 Subject: [PATCH] ci(ckeditor5): upload aggregate package coverage to Codecov MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI never produced coverage for packages/ckeditor5 (it ran in the catch-all "rest of the tests" step without --coverage), and the codecov-action steps upload only explicit hardcoded paths — so the package never reached Codecov. - dev.yml: run the ckeditor5 browser-mode suite with --coverage in its own step (sharing the chromedriver setup the other CKEditor tests use), upload the lcov + junit results to Codecov under a new `ckeditor5` flag, and drop ckeditor5 from the no-coverage catch-all so it isn't run twice. - vitest.config.ts: emit junit results and write coverage to test-output/vitest/coverage (matches the other suites' convention and lands under the already-gitignored test-output/ instead of an untracked coverage/). - codecov.yml: add the `ckeditor5` flag scoped to packages/ckeditor5/src/. This also makes CI enforce the package's 100% coverage gate (the threshold already lived in vitest.config.ts but was never exercised under --coverage). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/dev.yml | 25 ++++++++++++++++++++++++- codecov.yml | 4 ++++ packages/ckeditor5/vitest.config.ts | 2 ++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 43ab116bc2..fef27e8bfb 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -130,6 +130,29 @@ jobs: pnpm run --filter=ckeditor5-mermaid test pnpm run --filter=ckeditor5-math test + - name: Run the CKEditor 5 aggregate tests + run: | + export CHROMEDRIVER_PATH=$(which chromedriver || find /usr/local/share -name chromedriver -type f 2>/dev/null | head -1) + echo "Using chromedriver at: $CHROMEDRIVER_PATH" + pnpm run --filter=ckeditor5 test --coverage + + - name: Upload ckeditor5 coverage to Codecov + uses: codecov/codecov-action@v7 + if: always() + with: + files: packages/ckeditor5/test-output/vitest/coverage/lcov.info + flags: ckeditor5 + fail_ci_if_error: false + + - name: Upload ckeditor5 test results to Codecov + uses: codecov/test-results-action@v1 + if: ${{ !cancelled() }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: packages/ckeditor5/test-output/vitest/junit.xml + flags: ckeditor5 + fail_ci_if_error: false + - name: Run the desktop tests run: pnpm run --filter=desktop test --coverage @@ -171,7 +194,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-mermaid --filter=\!ckeditor5-math test + run: pnpm run --filter=\!client --filter=\!standalone --filter=\!server --filter=\!desktop --filter=\!commons --filter=\!ckeditor5-mermaid --filter=\!ckeditor5-math --filter=\!ckeditor5 test build_docker: name: Build Docker image diff --git a/codecov.yml b/codecov.yml index 62cc8c793c..9c56719575 100644 --- a/codecov.yml +++ b/codecov.yml @@ -41,6 +41,10 @@ flags: paths: - packages/commons/src/ carryforward: true + ckeditor5: + paths: + - packages/ckeditor5/src/ + carryforward: true comment: layout: "condensed_header, condensed_files, condensed_footer" diff --git a/packages/ckeditor5/vitest.config.ts b/packages/ckeditor5/vitest.config.ts index 467997e19a..235985fc44 100644 --- a/packages/ckeditor5/vitest.config.ts +++ b/packages/ckeditor5/vitest.config.ts @@ -13,6 +13,7 @@ export default defineConfig({ include: ["src/**/*.spec.ts"], globals: true, watch: false, + reporters: ["default", ["junit", { outputFile: "./test-output/vitest/junit.xml", addFileAttribute: true }]], coverage: { thresholds: { lines: 100, @@ -21,6 +22,7 @@ export default defineConfig({ statements: 100 }, provider: "v8", + reportsDirectory: "./test-output/vitest/coverage", // Restrict to this package's own sources. The aggregate imports the sibling // @triliumnext/ckeditor5-* workspace packages, whose `src/` would otherwise bleed // into this report; they carry their own 100% coverage gates in their own packages.