Skip to content

test(gui): add coverage baseline tests for logic layer - #56

Merged
CameronBrooks11 merged 2 commits into
mainfrom
chore/gui-coverage-baseline
Apr 15, 2026
Merged

CameronBrooks11 merged 2 commits into
mainfrom
chore/gui-coverage-baseline

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Set vitest coverage thresholds (lines/stmts 38%, fns 68%, branches 55%) and write 12 test files covering the pure-logic layer:

  • lib/retry - retry() + withRetry() with various failure modes
  • lib/recentFiles - localStorage CRUD, dedup, 10-item cap
  • lib/helicalValidation - all field validators + geometry hints
  • lib/streamFeedback - all connection/file/streaming/command namespaces
  • lib/commands - all 8 commands with schema-correct mock responses
  • lib/marlin-api - all invoke wrappers + event listeners
  • lib/fileOperations - all handler functions with dialog + command mocks
  • lib/numericFields - parseNumericInput + setFieldError
  • lib/menuConfig - MENU_DEFINITIONS structure assertions
  • stores/toastStore - addToast (auto-remove timer) + removeToast
  • types/project - type guards, getLayerData, createLayer
  • hooks/useDebouncedValue - debounce timing with fake timers

Also add perf/reports/ to .gitignore (generated build artifact).

Final coverage: lines 39.74%, fns 80.41%, branches 75.43%, stmts 39.74%
All quality gates pass: ruff, mypy, pytest, tsc, stylelint, cargo fmt, clippy

Set vitest coverage thresholds (lines/stmts 38%, fns 68%, branches 55%)
and write 12 test files covering the pure-logic layer:

- lib/retry          - retry() + withRetry() with various failure modes
- lib/recentFiles    - localStorage CRUD, dedup, 10-item cap
- lib/helicalValidation - all field validators + geometry hints
- lib/streamFeedback - all connection/file/streaming/command namespaces
- lib/commands       - all 8 commands with schema-correct mock responses
- lib/marlin-api     - all invoke wrappers + event listeners
- lib/fileOperations - all handler functions with dialog + command mocks
- lib/numericFields  - parseNumericInput + setFieldError
- lib/menuConfig     - MENU_DEFINITIONS structure assertions
- stores/toastStore  - addToast (auto-remove timer) + removeToast
- types/project      - type guards, getLayerData, createLayer
- hooks/useDebouncedValue - debounce timing with fake timers

Also add perf/reports/ to .gitignore (generated build artifact).

Final coverage: lines 39.74%, fns 80.41%, branches 75.43%, stmts 39.74%
All quality gates pass: ruff, mypy, pytest, tsc, stylelint, cargo fmt, clippy
CI (Linux v8) instruments ALL files matching the include glob, including
all nested component subdirectories (canvas/, dialogs/, editors/, forms/,
StreamTab/, contexts/, etc. - 60+ files total). Windows v8 only instruments
files actually imported during tests (~35 files), producing inflated
branch/function percentages that do not match CI reality.

To get consistent CI/local behavior, add 'all: true' explicitly.
The previous thresholds (functions: 68%, branches: 55%) were calibrated
against the partial Windows file set. Honest CI baselines:
  CI functions: 44.44%  =>  threshold 43%  (1.44% headroom)
  CI branches:  27.98%  =>  threshold 25%  (2.98% headroom)
  CI lines:     46.91%  =>  threshold 38%  (8.91% headroom, no change)
  CI stmts:     47.04%  =>  threshold 38%  (9.04% headroom, no change)
@CameronBrooks11
CameronBrooks11 merged commit d1aa4bd into main Apr 15, 2026
12 checks passed
@CameronBrooks11
CameronBrooks11 deleted the chore/gui-coverage-baseline branch April 15, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant