Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,19 @@ jobs:
- name: Install Playwright Chromium
run: yarn --cwd frontend playwright install ${{ matrix.os == 'ubuntu-latest' && '--with-deps' || '' }} chromium
- name: Run frontend browser-mode tests
run: yarn --cwd frontend ng run gui:test-browser
run: yarn --cwd frontend ng run gui:test-browser --coverage --coverage-reporters=lcovonly
- name: Upload frontend browser-mode coverage to Codecov
# These tests already exercise code the jsdom run cannot reach (Monaco, real
# pointer input); without this upload those lines are reported as uncovered.
# vitest.browser.config.ts writes to coverage-browser/ so this does not collide
# with the jsdom run's coverage/gui/lcov.info.
if: matrix.os == 'ubuntu-latest' && always()
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./frontend/coverage-browser/**/lcov.info
flags: frontend
fail_ci_if_error: false
- name: Upload frontend browser-mode test results to Codecov
# vitest.browser.config.ts emits junit-browser.xml (distinct from
# the unit-test report). Same `frontend` flag — Codecov merges
Expand Down
1 change: 1 addition & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# test coverage
/coverage
/coverage-browser

# vitest browser-mode snapshot baselines
**/__screenshots__/
Expand Down
14 changes: 13 additions & 1 deletion frontend/vitest.browser.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,27 @@ export default defineConfig({
// `require()` calls inside the CJS package crash on first import.
// Explicit-include forces esbuild to pre-bundle it (alongside its
// `base64-js` + `ieee754` transitive deps) into a browser-runnable ESM.
//
// `@vitest/coverage-v8/browser` is loaded dynamically by the coverage provider once
// `--coverage` is passed, and it is not in the import graph either, so it needs the same
// hint. Without it the run fails with "Failed to fetch dynamically imported module:
// /@id/@vitest/coverage-v8/browser" and no coverage is produced -- the tests still pass,
// which is why the gap went unnoticed.
optimizeDeps: {
include: ["buffer"],
include: ["buffer", "@vitest/coverage-v8/browser"],
},
test: {
// Emit a JUnit-XML report alongside the default console reporter so
// Codecov Test Analytics can ingest browser-mode failures and detect
// flakies on main. Written to a distinct filename so the upload step
// can disambiguate it from the unit-test report.
reporters: ["default", ["junit", { outputFile: "junit-browser.xml" }]],
// Written to its own directory so it does not overwrite the jsdom run's
// coverage/gui/lcov.info. Codecov merges multiple uploads under one flag, so both
// records count and the lines these tests already exercise stop reading as uncovered.
coverage: {
reportsDirectory: "coverage-browser",
},
globals: true,
// browser-buffer-polyfill must run FIRST: it puts Buffer/process on
// globalThis before any test module loads, which is required for
Expand Down
Loading