aglinxinyuan opened a new issue, #7462:
URL: https://github.com/apache/texera/issues/7462

   ### Task Summary
   
   Roughly **75 covered lines of `code-editor.component.ts` are missing from 
the coverage report** — not because they are untested, but because the tests 
that cover them never reach the coverage run.
   
   `code-editor.component.browser.spec.ts` passes today and exercises most of 
the Monaco integration. Two things keep it out of the numbers:
   
   1. `angular.json`'s `test` target sets `"exclude": 
["**/*.browser.spec.ts"]`, so the jsdom coverage run skips it entirely.
   2. `build.yml`'s `ng run gui:test-browser` step runs it, but with **no 
`--coverage` flag** and uploads only `junit-browser.xml` with `report_type: 
test_results` — so no lcov reaches Codecov.
   
   The result is that `code-editor.component.ts` reports 47% and appears near 
the top of every coverage-gap ranking, when the real gap is far smaller. Anyone 
working from that ranking will write ~75 lines of duplicate tests for behaviour 
that is already covered.
   
   ### Suggested next steps
   
   Either:
   
   - **add coverage to the browser step** — pass `--coverage 
--coverage-reporters=lcovonly` to `ng run gui:test-browser` and upload the 
resulting lcov alongside the jsdom one; or
   - **fold the browser specs back into jsdom.** A throwaway probe confirmed 
this now works: nothing in the file needs a real Monaco — a plain fake-editor 
object plus `vi.spyOn(EditorApp.prototype, "start"/"getEditor")` and a stubbed 
`ensureVscodeApiStarted` executes `initializeMonacoEditor`, 
`initializeDiffEditor`, `setupAIAssistantActions`, `handleTypeAnnotation` and 
`adjustEditorSize`.
   
   The first is cheaper and preserves the browser-mode signal; the second 
removes a second test mode.
   
   Whichever is chosen, the same question applies to any other 
`*.browser.spec.ts` in the repo — their coverage is invisible for the same 
reason.
   
   ### Additional context
   
   Found while ranking the remaining coverage gaps toward a 100% target. This 
one file distorts the ranking enough to be worth fixing before anyone works the 
list. Related: #7458, a different reason coverage under-reports (templates 
behind `TestBed.overrideComponent`).
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [x] DevOps / Deployment / CI
   - [ ] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to