fix(ci): propagate test failures and repair stale test fixtures - #450
Conversation
dimakis
left a comment
There was a problem hiding this comment.
Centaur Review
Found 2 issue(s).
frontend/src/pages/__tests__/CalendarView.test.tsx
Solid reliability fix — the shell: bash addition is the critical change (enables pipefail so npm test | tee no longer masks failures), and the test fixture updates correctly track component refactors. No bugs found.
- 🔵 style (L80): The 20-line
createMitzoStoreboilerplate is duplicated verbatim in SessionList.test.tsx (and a third variant exists in DesktopChatView.test.tsx). Consider extracting a sharedcreateTestStore()helper into a test-utils module to keep fixture updates in one place.[fixable]
server/__tests__/event-store.test.ts
Solid reliability fix — the shell: bash addition is the critical change (enables pipefail so npm test | tee no longer masks failures), and the test fixture updates correctly track component refactors. No bugs found.
- 🔵 regressions (L567): This changes the documented contract from 'inactive sessions are excluded from attention' to 'inactive sessions are included'. The implementation confirms the new assertion is correct (the SQL never filtered on is_active), but this is a semantic correction, not just a stale-fixture repair — the old test was asserting a behavior the code never had. Worth noting in the PR description so reviewers understand this is an intentional contract clarification, not just a test repair.
| const root = createRoot(container); | ||
| act(() => { | ||
| root.render(createElement(MemoryRouter, null, createElement(CalendarView))); | ||
| const store = createMitzoStore({ |
There was a problem hiding this comment.
🔵 style: The 20-line createMitzoStore boilerplate is duplicated verbatim in SessionList.test.tsx (and a third variant exists in DesktopChatView.test.tsx). Consider extracting a shared createTestStore() helper into a test-utils module to keep fixture updates in one place. [fixable]
| }); | ||
|
|
||
| it('excludes inactive sessions', () => { | ||
| it('includes completed sessions whose assistant response still needs attention', () => { |
There was a problem hiding this comment.
🔵 regressions: This changes the documented contract from 'inactive sessions are excluded from attention' to 'inactive sessions are included'. The implementation confirms the new assertion is correct (the SQL never filtered on is_active), but this is a semantic correction, not just a stale-fixture repair — the old test was asserting a behavior the code never had. Worth noting in the PR description so reviewers understand this is an intentional contract clarification, not just a test repair.
dimakis
left a comment
There was a problem hiding this comment.
Centaur Review
LGTM — no issues found.
Problem and change
The CI Test step pipes Vitest output through tee under the implicit shell, so failing tests can produce a successful check. Select explicit bash, which GitHub Actions runs with pipefail, to propagate test failures. Run CI for stacked PRs as well as PRs targeting main.
Repair the existing failing test harnesses: provide the app store in page tests; mock native Watch auth and the current desktop CommandCenter; target nested file anchors and profile buttons; wait for the duplicate-send animation-frame guard; include session-state methods in route mocks; align duplicate server tests with the shipped completion-attention and deduplicated resume contracts. Replace OS watcher timing races with deterministic callback, debounce, filtering, error, and cleanup tests.
The attention assertion intentionally clarifies the existing contract: completed sessions with an unanswered assistant response remain in attention, consistent with the canonical protocol-package test. It does not change runtime behavior. Component tests share a store fixture, and auto-rename client-selection tests mock Vertex construction so CI does not attempt real ADC discovery.
This is stacked on #449 and contains only the CI/test repairs. The Vertex feature remains in #449.
Validation