Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Tests: flaky ones wait for results instead of fixed sleeps, the summary frame check uses CI's visible window, timing checks take the best of five and heavy simulations get room

christianmat7644a35bd881
diff --git a/app/e2e/summaryRim.spec.ts b/app/e2e/summaryRim.spec.ts
index e2e454e6..a4fa0131 100644
--- a/app/e2e/summaryRim.spec.ts
+++ b/app/e2e/summaryRim.spec.ts
@@ -6,8 +6,10 @@ import type { NoteView } from '../src/shared/types'
for (const theme of ['light', 'dark'] as const) for (const width of [420, 860]) {
test(`summary frame follows writing and yields to reading at ${width}px in ${theme}`, async () => {
+ // the window's own setting (hidden locally, shown on CI): the summary unrolls on animation frames, which a hidden
+ // window pauses on Linux and Windows, so forcing it hidden left the summary empty now and then
const app = await electron.launch({ args: [join(import.meta.dirname, '../out/main/index.js')], env: {
- ...process.env, YOGURT_FAKE: '1', YOGURT_BACKGROUND: '1', YOGURT_USER_DATA: mkdtempSync(join(tmpdir(), 'yogurt-summary-rim-')),
+ ...process.env, YOGURT_FAKE: '1', YOGURT_USER_DATA: mkdtempSync(join(tmpdir(), 'yogurt-summary-rim-')),
} })
try {
const page = await app.firstWindow()
diff --git a/app/test/echoDetect.test.ts b/app/test/echoDetect.test.ts
index 2742d3a4..26dc0ce4 100644
--- a/app/test/echoDetect.test.ts
+++ b/app/test/echoDetect.test.ts
@@ -283,5 +283,6 @@ describe("round 3: the reviewer's turn-taking probe (shortened)", () => {
let heard = 0
for (let seed = 1; seed <= 6; seed++) { if (scene(seed, 0.15, [0.04], 1).end) heard++; if (scene(seed, 0.1, [0.02, 0.15], 1).end) heard++ }
expect(heard).toBeGreaterThanOrEqual(9)
- })
+ // twelve simulated calls: plain number crunching that needs more than 5 s on a busy machine
+ }, 30_000)
})
diff --git a/app/test/libraryVectors.test.ts b/app/test/libraryVectors.test.ts
index f4c3e91e..4c68a783 100644
--- a/app/test/libraryVectors.test.ts
+++ b/app/test/libraryVectors.test.ts
@@ -29,9 +29,9 @@ describe('vectors', () => {
for (let m = 0; m < 1000; m++) idx.set(`m${m}`, Array.from({ length: perMeeting }, (_, i) => ({ id: m * perMeeting + i, vector: toVector(Array.from({ length: dims }, () => Math.random() - 0.5), dims) })))
const q = toVector(Array.from({ length: dims }, () => Math.random() - 0.5), dims)
idx.top(q, 50)
- const t0 = performance.now()
- idx.top(q, 50)
- expect(performance.now() - t0).toBeLessThan(50)
+ // the best of five: one run can land on a busy moment of a shared test machine; what's measured is the search
+ const times = Array.from({ length: 5 }, () => { const t0 = performance.now(); idx.top(q, 50); return performance.now() - t0 })
+ expect(Math.min(...times)).toBeLessThan(50)
})
it('fuses rankings by reciprocal rank: found by both beats found high by one', () => {
expect(fuse([[1, 2, 3], [3, 4, 1]])).toEqual([1, 3, 2, 4])
diff --git a/app/test/notes.test.ts b/app/test/notes.test.ts
index dcfe2c24..96cf48b5 100644
--- a/app/test/notes.test.ts
+++ b/app/test/notes.test.ts
@@ -15,6 +15,8 @@ afterEach(() => {
dirs.splice(0).forEach((d) => rmSync(d, { recursive: true, force: true }))
})
const wait = (ms = 5) => new Promise((r) => setTimeout(r, ms))
+/** waits for what an assertion needs, up to 5 s: a fixed sleep was too short on a slow Windows runner */
+const until = (check: () => void) => vi.waitFor(check, { timeout: 5000, interval: 10 })
function setup(o: { summaryLanguage?: () => string; me?: string; named?: () => Promise<void>; namesWaitMs?: number; reply?: string | ((prompt: string) => string); during?: () => void; load?: Promise<void>; title?: string; recording?: () => boolean; smallMac?: boolean; showLoading?: boolean } = {}) {
const d = mkdtempSync(join(tmpdir(), 'yogurt-notes-'))
@@ -254,8 +256,7 @@ describe('hookNotes', () => {
s.stop(); s.transcribed()
await wait(10)
expect(s.prompts).toEqual([])
- await wait(60)
- expect(s.store.notes(s.m.id).enhanced).not.toBeNull()
+ await until(() => expect(s.store.notes(s.m.id).enhanced).not.toBeNull())
})
it('edits to the enhanced notes are saved and marked as edited; writing again clears that', async () => {
const s = setup()
@@ -308,26 +309,24 @@ describe('hookNotes', () => {
it('at launch, writes the notes a quit left unwritten', async () => {
const s = setup()
s.notes.recover()
- await wait(20)
- expect(s.store.notes(s.m.id).enhanced).not.toBeNull()
+ await until(() => expect(s.store.notes(s.m.id).enhanced).not.toBeNull())
})
it('notes edited while the rewrite was being written keep the edit', async () => {
// eslint-disable-next-line prefer-const
let s: ReturnType<typeof setup>
s = setup({ during: () => { if (s.prompts.length === 2) s.notes.setEnhanced(s.m.id, '## Edited') } })
- s.stop(); s.transcribed(); await wait(20)
+ s.stop(); s.transcribed(); await until(() => expect(s.store.notes(s.m.id).enhanced).not.toBeNull())
s.store.updateMeeting(s.m.id, { attendees: [{ name: 'Ann Lee', email: null }] })
s.notes.applyPeople(s.m.id)
- await wait(150)
- expect(s.prompts).toHaveLength(2)
+ await until(() => expect(s.prompts).toHaveLength(2))
expect(s.store.notes(s.m.id)).toMatchObject({ enhanced: '## Edited', edited: true })
})
it('an open note that kept its unsaved edits over the rewrite: the people still count as changed', async () => {
const s = setup()
- s.stop(); s.transcribed(); await wait(20)
+ s.stop(); s.transcribed(); await until(() => expect(s.store.notes(s.m.id).enhanced).not.toBeNull())
s.store.updateMeeting(s.m.id, { attendees: [{ name: 'Ann Lee', email: null }] })
s.notes.applyPeople(s.m.id)
- await wait(150)
+ await until(() => expect(s.prompts).toHaveLength(2))
expect(s.notes.view(s.m.id).peopleChanged).toBe(false)
s.notes.keptEdits(s.m.id)
s.notes.setEnhanced(s.m.id, '## Theirs, from before')
@@ -338,23 +337,21 @@ describe('hookNotes', () => {
const people = (...names: string[]) => s.store.updateMeeting(s.m.id, { attendees: names.map((name) => ({ name, email: null })) })
// eslint-disable-next-line prefer-const
s = setup({ during: () => { if (s.prompts.length === 2) { people('Ann Lee', 'Bo Park'); s.notes.applyPeople(s.m.id) } } })
- s.stop(); s.transcribed(); await wait(20)
+ s.stop(); s.transcribed(); await until(() => expect(s.store.notes(s.m.id).enhanced).not.toBeNull())
people('Ann Lee')
s.notes.applyPeople(s.m.id)
- await wait(250)
- expect(s.prompts).toHaveLength(3)
+ await until(() => expect(s.prompts).toHaveLength(3))
expect(s.prompts[2]).toContain('Bo Park')
expect(s.notes.view(s.m.id).peopleChanged).toBe(false)
})
it('people seen in the call after the notes were written (names from the call) get unedited notes written again too', async () => {
const reply = (prompt: string) => `## Plan\n- ${prompt.includes('Cy Dao') ? 'Cy' : 'Someone'} ships Tuesday\n## Next steps\n- **You:** Ship`
const s = setup({ reply })
- s.stop(); s.transcribed(); await wait(20)
+ s.stop(); s.transcribed(); await until(() => expect(s.store.notes(s.m.id).enhanced).not.toBeNull())
// what callNames does after the meeting: the attendees grow, then the notes hear of it
s.store.updateMeeting(s.m.id, { attendees: [{ name: 'Cy Dao', email: null }] })
s.notes.applyPeople(s.m.id)
- await wait(150)
- expect(s.store.notes(s.m.id).enhanced).toContain('Cy ships')
+ await until(() => expect(s.store.notes(s.m.id).enhanced).toContain('Cy ships'))
})
it('people added or removed after the notes were written: unedited notes are written again with them', async () => {
const reply = (prompt: string) => `## Plan\n- ${prompt.includes('Maya Chen') ? 'Maya' : 'Someone'} ships Tuesday\n## Next steps\n- **You:** Ship`
@@ -366,8 +363,7 @@ describe('hookNotes', () => {
// being written again on their own: no "write again?" hint meanwhile
expect(s.notes.view(s.m.id).peopleChanged).toBe(false)
expect(s.sent.at(-1)?.peopleChanged).toBe(false)
- await wait(150)
- expect(s.prompts).toHaveLength(2)
+ await until(() => expect(s.prompts).toHaveLength(2))
expect(s.store.notes(s.m.id).enhanced).toContain('Maya ships')
expect(s.notes.view(s.m.id).peopleChanged).toBe(false)
})
diff --git a/app/vitest.config.ts b/app/vitest.config.ts
index 4c2f7212..385ecde1 100644
--- a/app/vitest.config.ts
+++ b/app/vitest.config.ts
@@ -1,3 +1,3 @@
import { defineConfig } from 'vitest/config'
// GitHub's Windows runners open and write SQLite many times slower than a Mac: tests that take a second here pass 5 s there
-export default defineConfig({ test: { include: ['test/**/*.test.ts'], testTimeout: process.platform === 'win32' ? 30_000 : 5_000 } })
+export default defineConfig({ test: { include: ['test/**/*.test.ts'], testTimeout: process.platform === 'win32' ? 30_000 : 5_000, hookTimeout: process.platform === 'win32' ? 30_000 : 10_000 } })