Repository navigation
docs: add test coverage history log - #3367
Conversation
WalkthroughA new ChangesCoverage Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/COVERAGE.md`:
- Around line 29-33: The reference to docs/KNOWN_ISSUES.md in the "Quarantined
specs" section of the Known gaps section does not provide complete documentation
for the three mentioned specs (ServersView/ErrorView, ServerInfoContent,
AboutDialog). Either add detailed documentation to docs/KNOWN_ISSUES.md that
specifically explains why these three specs are quarantined and what RTL
auto-cleanup issues affect them, or update the cross-reference in COVERAGE.md to
remove the reference to KNOWN_ISSUES.md and include the necessary context
directly within the COVERAGE.md file instead.
- Around line 5-11: The documentation claims that both Jest projects (renderer
and main) run under the same `@kayahr/jest-electron-runner`, but the actual
configuration uses different runner variants: the renderer project uses
`@kayahr/jest-electron-runner` while the main project uses
`@kayahr/jest-electron-runner/main`. Update line 8 of the COVERAGE.md file to
accurately reflect this distinction by either specifying which runner variant
each project uses, or rephrasing to indicate that both use variants of the
electron-runner package family rather than claiming they use the exact same
runner.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c1e23625-036d-4c55-ac0a-59a4144e2ee0
📒 Files selected for processing (1)
docs/COVERAGE.md
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: check (ubuntu-latest)
- GitHub Check: check (windows-latest)
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (actions)
🧰 Additional context used
🪛 LanguageTool
docs/COVERAGE.md
[uncategorized] ~10-~10: The official name of this software platform is spelled with a capital “H”.
Context: ...nsole text-summary matches it). - CI (.github/workflows/validate-pr.yml) runs `yarn ...
(GITHUB)
🔇 Additional comments (3)
docs/COVERAGE.md (3)
12-18: LGTM!
19-27: LGTM!
35-41: LGTM!
| ## How coverage is measured | ||
|
|
||
| - `yarn test:coverage` runs the full Jest suite with `--coverage` and writes reports to `coverage/` (`lcov.info`, `coverage-summary.json`, plus a `text-summary` to the console). | ||
| - Two Jest projects run under `@kayahr/jest-electron-runner`: renderer (electron DOM env) and main (node env). Coverage is collected across both via the root-level `collectCoverageFrom` in `jest.config.js`. | ||
| - The authoritative number is `coverage/coverage-summary.json` → `total.lines.pct` (the console `text-summary` matches it). | ||
| - CI (`.github/workflows/validate-pr.yml`) runs `yarn test:coverage` on every PR to `master`/`dev` and uploads to **Codecov** (`unit` flag). Coverage is **informational** — there is intentionally no hard `coverageThreshold` gate, matching the main Rocket.Chat monorepo's house style (`codecov.yml`: `patch: off`, project `target: auto / threshold: 1%`). | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that jest.config.js defines two projects and that the main project is configured
# Search for the projects array definition and all project configs
ast-grep --pattern $'const $___ = {
projects: [
$$$
]
}'Repository: RocketChat/Rocket.Chat.Electron
Length of output: 57
🏁 Script executed:
# Find and read jest.config.js to verify project structure
find . -name "jest.config.js" -type f | head -5Repository: RocketChat/Rocket.Chat.Electron
Length of output: 92
🏁 Script executed:
# Also check the structure of the repository
git ls-files | grep -E "(jest\.config|\.github/workflows|coverage)" | head -20Repository: RocketChat/Rocket.Chat.Electron
Length of output: 239
🏁 Script executed:
# Read jest.config.js to verify the two projects claim
cat -n jest.config.js | head -100Repository: RocketChat/Rocket.Chat.Electron
Length of output: 1458
🏁 Script executed:
# Read the validate-pr.yml workflow to verify it runs yarn test:coverage
cat -n .github/workflows/validate-pr.yml | head -100Repository: RocketChat/Rocket.Chat.Electron
Length of output: 4530
Clarify the runner configuration for the main project.
Line 8 claims that "Two Jest projects run under @kayahr/jest-electron-runner," but the jest.config.js configuration shows the two projects use different runners: the renderer project uses @kayahr/jest-electron-runner, while the main project uses @kayahr/jest-electron-runner/main. Update the documentation to reflect this distinction — either specify the runner variant for each project or rephrase to indicate both use the electron-runner package family.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~10-~10: The official name of this software platform is spelled with a capital “H”.
Context: ...nsole text-summary matches it). - CI (.github/workflows/validate-pr.yml) runs `yarn ...
(GITHUB)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/COVERAGE.md` around lines 5 - 11, The documentation claims that both
Jest projects (renderer and main) run under the same
`@kayahr/jest-electron-runner`, but the actual configuration uses different
runner variants: the renderer project uses `@kayahr/jest-electron-runner` while
the main project uses `@kayahr/jest-electron-runner/main`. Update line 8 of the
COVERAGE.md file to accurately reflect this distinction by either specifying
which runner variant each project uses, or rephrasing to indicate that both use
variants of the electron-runner package family rather than claiming they use the
exact same runner.
| ## Known gaps / next steps | ||
|
|
||
| - **Goal:** 50% lines. At 33.29% as of the last row — reachable via the renderer (`ui/`) layer alone; no need to test webview/Electron-integration files. | ||
| - **Quarantined specs** (written but held back — they leak async/DOM teardown that the strict `uncaughtException` handler in `src/.jest/setup.ts` turns into a suite-killing `process.exit(1)`): `ServersView/ErrorView`, `ServerInfoContent`, `AboutDialog`. Re-enabling these (with proper fake-timer / async cleanup) is the cheapest next win. See `docs/KNOWN_ISSUES.md`. | ||
| - **Remaining headroom:** the rest of `ui/components` dialogs/containers, and non-webview `ui/main` logic. |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if docs/KNOWN_ISSUES.md exists and contains references to the quarantined specs
if [ -f docs/KNOWN_ISSUES.md ]; then
echo "docs/KNOWN_ISSUES.md exists"
grep -n "ServersView\|ServerInfoContent\|AboutDialog" docs/KNOWN_ISSUES.md || echo "None of the three quarantined specs found in the file"
else
echo "docs/KNOWN_ISSUES.md does not exist"
fiRepository: RocketChat/Rocket.Chat.Electron
Length of output: 157
🏁 Script executed:
cat docs/KNOWN_ISSUES.mdRepository: RocketChat/Rocket.Chat.Electron
Length of output: 3405
🏁 Script executed:
sed -n '25,35p' docs/COVERAGE.mdRepository: RocketChat/Rocket.Chat.Electron
Length of output: 1539
The reference to docs/KNOWN_ISSUES.md in line 32 is incomplete.
The file exists and documents the related RTL auto-cleanup issue that affects the src/.jest/setup.ts uncaughtException handler, but it does not specifically document why the three quarantined specs (ServersView/ErrorView, ServerInfoContent, AboutDialog) are held back. Developers looking for documentation on these specific tests will not find them in the referenced file. Either add documentation for these three specs to docs/KNOWN_ISSUES.md or remove/update the cross-reference.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/COVERAGE.md` around lines 29 - 33, The reference to docs/KNOWN_ISSUES.md
in the "Quarantined specs" section of the Known gaps section does not provide
complete documentation for the three mentioned specs (ServersView/ErrorView,
ServerInfoContent, AboutDialog). Either add detailed documentation to
docs/KNOWN_ISSUES.md that specifically explains why these three specs are
quarantined and what RTL auto-cleanup issues affect them, or update the
cross-reference in COVERAGE.md to remove the reference to KNOWN_ISSUES.md and
include the necessary context directly within the COVERAGE.md file instead.
What
Adds
docs/COVERAGE.md— an append-only log of test-coverage milestones so future changes can be recorded and the trajectory stays visible.Contents
yarn test:coverage, the two jest projects, Codecov informational reporting — no hard gate, matching the main monorepo).fireEvent.changevsuserEvent.type, timer-leak → suite kill, batch-verify discipline).Docs only — no code or config change.
Summary by CodeRabbit