KokoroTtsLiveTests.cscsharp

Documentation

Version 3 design tests

Automated checks for chat, history, and Kokoro TTS (sanitizer + optional live speech).

Quick run

python src/Version3/DesignTests/run-design-tests.py
python src/Version3/DesignTests/run-design-tests.py --live
.\src\Version3\DesignTests\run-design-tests.ps1 -Live

What runs

| Suite | Needs network | Covers | |-------|----------------|--------| | ChatHistoryStoreTests | No | Same as V1 history XML | | OllamaClientHistoryTests | No | Client save/load | | KokoroTtsSanitizerTests | No | Markdown/emoji/URL stripping for speech | | OllamaLiveTests | Yes (--live) | Ollama chat | | KokoroTtsLiveTests | Yes (--live) | Kokoro model load + SpeakAsync |

First Kokoro live run may download ~320MB of model weights.

Console video (testers)

Record Version 3 console sessions (chat + TTS + history):

python src/TestManager/test_manager.py record v2 chat-tts --build

See src/TestManager/README.md.

All versions

python src/run-all-design-tests.py
python src/run-all-design-tests.py --live
using Agent.Core.Logging;using Agent.Core.TextToSpeech;using Xunit;namespace Agent.Core.DesignTests;/// <summary>Kokoro model download + playback. Slow; run with --live only.</summary>[Trait("Category", "Integration")]public class KokoroTtsLiveTests{    [Fact]    public async Task Kokoro_speaks_sanitized_phrase()    {        Assert.True(LiveTestsEnabled(), "Set RUN_LIVE_TESTS=1 or pass --live to run-design-tests.py");        var logger = new Logger();        var tts = await KokoroTts.CreateAsync(logger);        string sample = "Version two design test. Kokoro speech is working.";        await tts.SpeakAsync(sample);        Assert.False(string.IsNullOrWhiteSpace(KokoroTtsSanitizer.Sanitize(sample)));    }    private static bool LiveTestsEnabled() =>        string.Equals(Environment.GetEnvironmentVariable("RUN_LIVE_TESTS"), "1", StringComparison.Ordinal);}