358 lines
17 KiB
Plaintext
358 lines
17 KiB
Plaintext
|
||
RUN v3.1.2 C:/Users/Lucian/multica_workspaces_desktop-api.solsum.cn/hello-af23464d222e/hel-898-60677d46f686/workdir/before/web
|
||
|
||
❯ tests/voice.test.ts (43 tests | 12 failed) 459ms
|
||
✓ honest switch > reads status only: no room, no microphone 14ms
|
||
✓ honest switch > configured && tts_ok never means "verified": voice:false is not read as connected 1ms
|
||
✓ honest switch > refuses honestly before touching the microphone when the server cannot speak 1ms
|
||
✓ honest switch > an insecure page is told why, without asking for the microphone 0ms
|
||
✓ lifecycle > opens, joins, publishes the microphone, follows her state; ending stops everything 1ms
|
||
✓ lifecycle > permission denied: nothing opened on the server, nothing left running 1ms
|
||
✓ lifecycle > server refusal shows its own words and releases the microphone 0ms
|
||
✓ lifecycle > a failed join releases the microphone and gives the room back 0ms
|
||
✓ lifecycle > ending while the microphone prompt is open: the late microphone is stopped, no room is asked for 8ms
|
||
✓ lifecycle > ending while the room is being opened: the late grant is given back, never joined 31ms
|
||
✓ lifecycle > ending while joining: the join is aborted, a late room is closed, the server room deleted 36ms
|
||
✓ lifecycle > rapid on/off/on: only the last call stays, every earlier microphone and room is released 17ms
|
||
✓ lifecycle > late events from an ended call never bring it back 14ms
|
||
✓ lifecycle > the room dropping on its own (network, server ended it) cleans up and says so 15ms
|
||
✓ lifecycle > microphone permission revoked mid-call ends the call 16ms
|
||
✓ lifecycle > her worker never joining is a failure, not an endless wait 2ms
|
||
✓ lifecycle > offline ends with its own words; unload releases at once and the DELETE survives the page 25ms
|
||
✓ lifecycle > a DELETE that cannot get through (offline) is owed, survives a new page, and is sent once back online 1ms
|
||
✓ lifecycle > an owed room already gone on the server (404) counts as settled 0ms
|
||
✓ lifecycle > never confirms a receipt or posts chat itself: the worker owns both 11ms
|
||
✓ a late end of an older call > the room dropped, its DELETE (and the settle retry) answering after a new call is up, leaves the new call alone 62ms
|
||
✓ a late end of an older call > the microphone was taken away, its DELETE (and the settle retry) answering after a new call is up, leaves the new call alone 58ms
|
||
✓ a late end of an older call > her worker never joined, the DELETE is slow, and a new call is started before it answers 2ms
|
||
✓ a late end of an older call > a normal end whose DELETE is slow, then a new call, then the old answer arrives 2ms
|
||
✓ a late end of an older call > starting again while the previous start still waits for the old room to be given back: only the newest call survives 71ms
|
||
✓ a late end of an older call > a microphone granted late to an older start is stopped without touching the new call 31ms
|
||
× subtitles and the two channels > interim is a draft; user_final cancels a text reply and asks for the record; φ is heard but not recorded 9ms
|
||
→ expected { phase: 'listening', heard: '', …(3) } to match object { spoken: '我刚才走神了,你再说一遍?', her: null }
|
||
(4 matching properties omitted from actual)
|
||
✓ subtitles and the two channels > without the agent state attribute, subtitles still move the state honestly 1ms
|
||
✓ subtitles and the two channels > typing over her spoken answer silences what is left of it until she is listening again 1ms
|
||
× her voice line (cg.subtitle v2) > rejects anything that is not exactly a v2 frame 1ms
|
||
→ expected 10 to be 3 // Object.is equality
|
||
× her voice line (cg.subtitle v2) > normal turn: your draft and final, her growing reply replaced in place, then her stored final 2ms
|
||
→ expected [ '你在听的', '你在听吗?', '你在听吗?', …(4) ] to deeply equal [ '你在听的', '你在听吗?', { …(3) }, …(4) ]
|
||
× her voice line (cg.subtitle v2) > interrupted: no final, her line goes at once, its late frames never reach the new turn 6ms
|
||
→ expected undefined to match object { speech: 'speech_cut', …(2) }
|
||
× her voice line (cg.subtitle v2) > frames that overtook each other: a lower seq is stale; an older speech never touches or closes the new one 1ms
|
||
→ expected undefined to be '一二三' // Object.is equality
|
||
× her voice line (cg.subtitle v2) > reach-out read aloud: shown whole with its stored message id, interruptible, nothing marked or stored 1ms
|
||
→ expected { phase: 'listening', heard: '', …(3) } to match object { phase: 'speaking', her: { …(5) } }
|
||
(4 matching properties omitted from actual)
|
||
× her voice line (cg.subtitle v2) > a reach-out cut by your voice: the cancel clears it, your words follow 1ms
|
||
→ expected { phase: 'listening', …(4) } to match object { heard: '等等', …(1) }
|
||
(4 matching properties omitted from actual)
|
||
× her voice line (cg.subtitle v2) > text taking over, hanging up and starting again each clear her line at once 1ms
|
||
→ expected undefined to be null
|
||
× her voice line (cg.subtitle v2) > the room dropping mid-sentence clears her line with the call 9ms
|
||
→ expected { phase: 'off', heard: '', …(3) } to match object { phase: 'off', her: null, …(1) }
|
||
(3 matching properties omitted from actual)
|
||
× her voice line on the stage > grows in her slot after your voice turn; the stored row takes over under the same line keys 0ms
|
||
→ (0 , voiceLine) is not a function
|
||
× her voice line on the stage > a finished line never stands in front of a newer turn; an open one waits for its own end 0ms
|
||
→ (0 , voiceLine) is not a function
|
||
× her voice line on the stage > a reach-out read aloud keeps its stored row identity and gives way when that row is the newest line 0ms
|
||
→ (0 , voiceLine) is not a function
|
||
✓ record re-read > adds voice turns once, in id order; leaves reach-outs to the inbox and text turns to the stream 0ms
|
||
✓ record re-read > a pending voice row settles in place (sent or cancelled), never duplicated 0ms
|
||
✓ record re-read > reads newest pages down to what the page holds, bounded 2ms
|
||
node :
|
||
At line:4 char:24
|
||
+ ... efore\web"; node node_modules\vitest\vitest.mjs run tests/voice.test. ...
|
||
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
+ CategoryInfo : NotSpecified: (:String) [], RemoteException
|
||
+ FullyQualifiedErrorId : NativeCommandError
|
||
|
||
⎯⎯⎯⎯⎯⎯ Failed Tests 12 ⎯⎯⎯⎯⎯⎯⎯
|
||
|
||
FAIL tests/voice.test.ts > subtitles and the two channels > interim is a draft; user_final cancels a text reply and
|
||
asks for the record; φ is heard but not recorded
|
||
AssertionError: expected { phase: 'listening', heard: '', …(3) } to match object { spoken: '我刚才走神了,你再说一遍?', her: null }
|
||
(4 matching properties omitted from actual)
|
||
|
||
- Expected
|
||
+ Received
|
||
|
||
{
|
||
- "her": null,
|
||
"spoken": "我刚才走神了,你再说一遍?",
|
||
}
|
||
|
||
❯ tests/voice.test.ts:361:26
|
||
359| room.on.subtitle(frame(4, 'assistant_interim', { speech_id: 'a…
|
||
360| room.on.subtitle(frame(5, 'error', { speech_id: 'a', text: '我刚…
|
||
361| expect(r.view()).toMatchObject({ spoken: '我刚才走神了,你再说一遍?', her:…
|
||
| ^
|
||
362| room.on.subtitle(frame(6, 'turn_cancel', { speech_id: 'a', rea…
|
||
363| expect(r.view()).toMatchObject({ spoken: '我刚才走神了,你再说一遍?', her:…
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line (cg.subtitle v2) > rejects anything that is not exactly a v2 frame
|
||
AssertionError: expected 10 to be 3 // Object.is equality
|
||
|
||
- Expected
|
||
+ Received
|
||
|
||
- 3
|
||
+ 10
|
||
|
||
❯ tests/voice.test.ts:407:32
|
||
405| ];
|
||
406| for (const b of bad) room.on.subtitle(b);
|
||
407| expect(r.views.length).toBe(seen); expect(r.record).not.toHave…
|
||
| ^
|
||
408| // A rejected frame does not move the sequence: the first good…
|
||
409| room.on.subtitle(frame(1, 'interim', { text: '好的' })); expect(…
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line (cg.subtitle v2) > normal turn: your draft and final, her growing reply
|
||
replaced in place, then her stored final
|
||
AssertionError: expected [ '你在听的', '你在听吗?', '你在听吗?', …(4) ] to deeply equal [ '你在听的', '你在听吗?', { …(3) }, …(4) ]
|
||
|
||
- Expected
|
||
+ Received
|
||
|
||
[
|
||
"你在听的",
|
||
"你在听吗?",
|
||
- {
|
||
- "speech": "speech_normal",
|
||
- "state": "open",
|
||
- "text": "",
|
||
- },
|
||
- {
|
||
- "speech": "speech_normal",
|
||
- "state": "open",
|
||
- "text": "在听呢,",
|
||
- },
|
||
- {
|
||
- "speech": "speech_normal",
|
||
- "state": "open",
|
||
- "text": "在听呢,在听呢,你刚才说到一半的那件事我还在想。",
|
||
- },
|
||
- {
|
||
- "speech": "speech_normal",
|
||
- "state": "final",
|
||
- "text": "在听呢,你刚才说到一半的那件事我还在想。",
|
||
- "turnId": "0e2f-demo-turn",
|
||
- },
|
||
- {
|
||
- "speech": "speech_normal",
|
||
- "state": "done",
|
||
- "text": "在听呢,你刚才说到一半的那件事我还在想。",
|
||
- "turnId": "0e2f-demo-turn",
|
||
- },
|
||
+ "你在听吗?",
|
||
+ "你在听吗?",
|
||
+ "你在听吗?",
|
||
+ "",
|
||
+ "",
|
||
]
|
||
|
||
❯ tests/voice.test.ts:415:23
|
||
413| const steps: (VoiceView['her'] | string)[] = [];
|
||
414| play(room, frames, () => steps.push(r.view().her ? { ...r.view…
|
||
415| expect(steps).toEqual([
|
||
| ^
|
||
416| '你在听的', '你在听吗?',
|
||
417| { speech: 'speech_normal', text: '', state: 'open' },
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line (cg.subtitle v2) > interrupted: no final, her line goes at once, its late
|
||
frames never reach the new turn
|
||
AssertionError: expected undefined to match object { speech: 'speech_cut', …(2) }
|
||
|
||
- Expected:
|
||
{
|
||
"speech": "speech_cut",
|
||
"state": "open",
|
||
"text": "我正想跟你说,今天下午",
|
||
}
|
||
|
||
+ Received:
|
||
undefined
|
||
|
||
❯ tests/voice.test.ts:438:30
|
||
436| const r = await connected(), room = r.transport.rooms[0], fram…
|
||
437| play(room, frames.slice(0, 2));
|
||
438| expect(r.view().her).toMatchObject({ speech: 'speech_cut', tex…
|
||
| ^
|
||
439| play(room, frames.slice(2, 3));
|
||
440| expect(r.view().her).toBeNull();
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line (cg.subtitle v2) > frames that overtook each other: a lower seq is stale;
|
||
an older speech never touches or closes the new one
|
||
AssertionError: expected undefined to be '一二三' // Object.is equality
|
||
|
||
- Expected:
|
||
"一二三"
|
||
|
||
+ Received:
|
||
undefined
|
||
|
||
❯ tests/voice.test.ts:454:36
|
||
452| room.on.subtitle(frame(3, 'assistant_interim', { speech_id: 'a…
|
||
453| room.on.subtitle(frame(2, 'assistant_interim', { speech_id: 'a…
|
||
454| expect(r.view().her?.text).toBe('一二三');
|
||
| ^
|
||
455| // Two handles: b starts while a is still open (queued then ge…
|
||
456| room.on.subtitle(frame(4, 'turn_start', { speech_id: 'b' }));
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line (cg.subtitle v2) > reach-out read aloud: shown whole with its stored
|
||
message id, interruptible, nothing marked or stored
|
||
AssertionError: expected { phase: 'listening', heard: '', …(3) } to match object { phase: 'speaking', her: { …(5) } }
|
||
(4 matching properties omitted from actual)
|
||
|
||
- Expected
|
||
+ Received
|
||
|
||
{
|
||
- "her": {
|
||
- "messageId": 17,
|
||
- "proactive": true,
|
||
- "speech": "speech_pro1",
|
||
- "state": "open",
|
||
- "text": "我看到一句很适合现在的话,先念给你听。",
|
||
- },
|
||
- "phase": "speaking",
|
||
+ "phase": "listening",
|
||
}
|
||
|
||
❯ tests/voice.test.ts:471:26
|
||
469| const r = await connected(), room = r.transport.rooms[0], fram…
|
||
470| play(room, frames.slice(0, 1));
|
||
471| expect(r.view()).toMatchObject({ phase: 'speaking', her: { spe…
|
||
|
||
Test Files 1 failed (1)
|
||
Tests 12 failed | 31 passed (43)
|
||
Start at 17:45:16
|
||
Duration 875ms (transform 138ms, setup 0ms, collect 219ms, tests 459ms, environment 0ms, prepare 60ms)
|
||
|
||
| ^
|
||
472| room.on.subtitle(frame(2, 'proactive_end', { speech_id: 'speec…
|
||
473| expect(r.view().her?.state).toBe('open');
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line (cg.subtitle v2) > a reach-out cut by your voice: the cancel clears it,
|
||
your words follow
|
||
AssertionError: expected { phase: 'listening', …(4) } to match object { heard: '等等', …(1) }
|
||
(4 matching properties omitted from actual)
|
||
|
||
- Expected
|
||
+ Received
|
||
|
||
{
|
||
"heard": "等等",
|
||
- "her": {
|
||
- "speech": "p",
|
||
- "state": "open",
|
||
- },
|
||
}
|
||
|
||
❯ tests/voice.test.ts:486:26
|
||
484| room.on.subtitle(frame(1, 'proactive_start', { speech_id: 'p',…
|
||
485| room.on.subtitle(frame(2, 'interim', { text: '等等' }));
|
||
486| expect(r.view()).toMatchObject({ heard: '等等', her: { speech: '…
|
||
| ^
|
||
487| room.on.subtitle(frame(3, 'proactive_cancel', { speech_id: 'p'…
|
||
488| expect(r.view()).toMatchObject({ heard: '等等', her: null });
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line (cg.subtitle v2) > text taking over, hanging up and starting again each
|
||
clear her line at once
|
||
AssertionError: expected undefined to be null
|
||
|
||
- Expected:
|
||
null
|
||
|
||
+ Received:
|
||
undefined
|
||
|
||
❯ tests/voice.test.ts:496:30
|
||
494| room.on.subtitle(frame(2, 'assistant_interim', { speech_id: 'a…
|
||
495| r.c.hush();
|
||
496| expect(r.view().her).toBeNull(); expect(room.hushed).toEqual([…
|
||
| ^
|
||
497| room.on.subtitle(frame(3, 'assistant_interim', { speech_id: 'a…
|
||
498| expect(r.view().her).toBeNull();
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line (cg.subtitle v2) > the room dropping mid-sentence clears her line with the
|
||
call
|
||
AssertionError: expected { phase: 'off', heard: '', …(3) } to match object { phase: 'off', her: null, …(1) }
|
||
(3 matching properties omitted from actual)
|
||
|
||
- Expected
|
||
+ Received
|
||
|
||
{
|
||
- "her": null,
|
||
"notice": "通话断开了,麦克风已经关闭。文字仍可使用。",
|
||
"phase": "off",
|
||
}
|
||
|
||
❯ tests/voice.test.ts:526:26
|
||
524| room.on.subtitle(frame(2, 'assistant_interim', { speech_id: 'a…
|
||
525| room.on.dropped(); await flush();
|
||
526| expect(r.view()).toMatchObject({ phase: 'off', her: null, noti…
|
||
| ^
|
||
527| });
|
||
528| });
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[9/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line on the stage > grows in her slot after your voice turn; the stored row
|
||
takes over under the same line keys
|
||
TypeError: (0 , voiceLine) is not a function
|
||
❯ tests/voice.test.ts:537:25
|
||
535| it('grows in her slot after your voice turn; the stored row takes …
|
||
536| const open: HerLine = { speech: 's', text: '在听呢,你刚才说到一半的那件事我一直…
|
||
537| const growing = voiceLine(open, [you], 1)!;
|
||
| ^
|
||
538| expect(growing).toMatchObject({ role: 'companion', live: 'gene…
|
||
539| // The newest line of a reply still growing is held back, as i…
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[10/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line on the stage > a finished line never stands in front of a newer turn; an
|
||
open one waits for its own end
|
||
TypeError: (0 , voiceLine) is not a function
|
||
❯ tests/voice.test.ts:550:16
|
||
548| it('a finished line never stands in front of a newer turn; an open…
|
||
549| const done: HerLine = { speech: 's', text: '好。', state: 'done'…
|
||
550| expect(voiceLine(done, [you, M(6, 'user', '还有', 'U')], 1)).toB…
|
||
| ^
|
||
551| expect(voiceLine({ ...done, state: 'open' }, [you, M(6, 'user'…
|
||
552| expect(voiceLine({ ...done, text: '' }, [you], 1)).toBeNull();
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[11/12]⎯
|
||
|
||
FAIL tests/voice.test.ts > her voice line on the stage > a reach-out read aloud keeps its stored row identity and
|
||
gives way when that row is the newest line
|
||
TypeError: (0 , voiceLine) is not a function
|
||
❯ tests/voice.test.ts:558:25
|
||
556| const row = M(17, 'companion', line.text, 'R', { proactive: tr…
|
||
557| const before = [you, M(5, 'companion', '在。', 'T')];
|
||
558| const waiting = voiceLine(line, before, 2, [row])!;
|
||
| ^
|
||
559| expect(waiting).toMatchObject({ id: '17', turnId: 'R', proacti…
|
||
560| expect(stage([...before, waiting])).toEqual(stage([...before, …
|
||
|
||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[12/12]⎯
|
||
|