Skip to content

Test Coverage & Quality Assurance Specification ​

LocalLLMServerManager v3.5.0 | Target: .NET 10 LTS | Avalonia UI & WebAssembly | Microsoft Playwright

This document provides a comprehensive audit of all unit, integration, mock server, and end-to-end (E2E) Playwright browser automation tests across the LocalLLMServerManager codebase on both Windows and Linux environments.


πŸ“Š Executive Summary & Test Metrics ​

MetricMeasured ValueOperational Notes
Total Tests Executed174Comprehensive test suite across Windows and Linux
Passed Tests173 (99.4%)All unit, integration, and UI tests pass
Skipped Tests1 (0.6%)On-demand Playwright screenshot generator
Failed Tests0 (0.0%)Zero test failures across test suite
Test Fixture Classes20Modular test fixtures partitioned by domain
Target RuntimesWindows 11 x64, Linux x64 (systemd, X11, Wayland), Headless ChromiumDual-OS verified

Testing Frameworks & Tooling ​

  • Test Runner: xUnit.net v3 (xunit.v3 3.2.2)
  • Headless UI Testing: Avalonia.Headless.XUnit (12.1.1)
  • Mocking & Isolation: Moq (4.20.72)
  • Browser E2E Automation: Microsoft.Playwright (1.50.0) with Chromium WebGL SwiftShader emulation
  • Code Coverage Instrumentation: coverlet.collector (10.0.1)

🧩 Chunked Test Execution Architecture ​

To eliminate port contention and process memory race conditions during local and CI/CD test runs on Windows and Linux, the test suite is partitioned into five targeted execution chunks:

Execution Commands ​

bash
# Chunk 1: ViewModels, Settings & UI (37 tests)
dotnet test LocalLLMServerManager.Tests/LocalLLMServerManager.Tests.csproj --filter "FullyQualifiedName~ViewModel|FullyQualifiedName~AppSettings|FullyQualifiedName~AvaloniaUi|FullyQualifiedName~MainWindowUi" -c Release --nologo

# Chunk 2: Services, Tool Discovery, VRAM Orchestrator & Static Files (46 tests)
dotnet test LocalLLMServerManager.Tests/LocalLLMServerManager.Tests.csproj --filter "FullyQualifiedName~Services|FullyQualifiedName~VramOrchestrator|FullyQualifiedName~StaticFile|FullyQualifiedName~ToolDiscovery|FullyQualifiedName~BrowserLauncher" -c Release --nologo

# Chunk 3: Endpoints, System, Mock Servers & Workflows (67 tests)
dotnet test LocalLLMServerManager.Tests/LocalLLMServerManager.Tests.csproj --filter "FullyQualifiedName~ServerEndpoints|FullyQualifiedName~DiscoveryEndpoints|FullyQualifiedName~EndToEndSystem|FullyQualifiedName~LiveExternal|FullyQualifiedName~WorkflowPerformance" -c Release --nologo

# Chunk 4: Model Context Protocol (MCP) Integration Tests (22 tests)
dotnet test LocalLLMServerManager.Tests/LocalLLMServerManager.Tests.csproj --filter "FullyQualifiedName~McpServerIntegrationTests" -c Release --nologo

# Chunk 5: Playwright WebAssembly Browser E2E & Screenshot Generator (2 tests)
dotnet test LocalLLMServerManager.Tests/LocalLLMServerManager.Tests.csproj --filter "FullyQualifiedName~Playwright" -c Release --nologo

πŸ—ΊοΈ Component-by-Component Test Mapping ​

Layer / ComponentSource File(s)Primary Test File(s)Verified Capabilities & Assertions
Host BootstrapperProgram.csServerEndpointsTests.cs
ServerInfrastructureAndAppTests.cs
ASP.NET Core Kestrel initialization, DI service container configuration, port binding, command line flag parsing (--service, --headless).
System Tray & Desktop LifecycleApp.axaml.cs
LocalLLMServerManager.csproj
AvaloniaUiTests.cs
MainWindowUiTests.cs
Avalonia desktop app builder, system tray icon lifecycle, tray menu commands (Open Dashboard, View Health, Exit), desktop window auto-attachment to background service.
AI Engine ManagerServices/AiEngineManager.csServicesAndEngineManagerTests.csProcess lifecycle for Ollama (11434), Forge (7860), ComfyUI (8188), process health monitoring, graceful shutdown, Win32 Job Object memory caps.
Tool Discovery ServiceServices/ToolDiscoveryService.cs
Interfaces/IToolDiscoveryService.cs
ToolDiscoveryServiceTests.csMulti-drive filesystem scanning for Ollama, ComfyUI, and SD Forge installations, path validation (Valid, NotFound, Invalid), environment variable expansion.
GPU Telemetry ProviderServices/GpuTelemetryProvider.csServerEndpointsTests.cs
ServicesAndEngineManagerTests.cs
Cross-platform GPU VRAM telemetry reading NVML CUDA (nvidia-smi), Windows Registry fallback, and Linux /proc/meminfo fallback.
VRAM OrchestratorServices/VramOrchestrator.csVramOrchestratorTests.cs
MainViewModelTests.cs
Proactive memory orchestration: sends keep_alive: 0 to Ollama before Stable Diffusion or ComfyUI generation, ComfyUI /free call, Forge progress polling.
Settings ServiceServices/SettingsService.cs
LocalLLMServerManager.Shared/Models/AppSettings.cs
AppSettingsTests.cs
ServerEndpointsTests.cs
Persistent JSON settings storage (appsettings.json / settings.json), environment variable expansion (%APPDATA%), default fallback handling.
Git Update ServiceServices/GitUpdateService.csServicesAndEngineManagerTests.cs
ServerEndpointsTests.cs
Git branch validation, fetch, pull, and checkout command execution with error handling for in-app self-updates.
Win32 Job ObjectServices/Win32JobObject.csServerInfrastructureAndAppTests.cs
ServicesAndEngineManagerTests.cs
Windows Win32 Job Object memory quota limits and child process termination on parent exit; graceful no-op on Linux.
Health APIEndpoints/HealthEndpoints.csServerEndpointsTests.csGET /health returns HTTP 200 OK, engine health states, and version 3.5.0.
Discovery APIEndpoints/DiscoveryEndpoints.csDiscoveryEndpointsTests.csPOST /api/tools/detect (scans drives and returns detected tools), POST /api/tools/validate-path (dynamically checks file/directory validity).
Engine APIEndpoints/EngineEndpoints.csServerEndpointsTests.csGET /api/gpu/vram, GET /api/settings, POST /api/settings, /api/comfy/*, /api/forge/*.
Model Proxy APIEndpoints/ModelProxyEndpoints.csServerEndpointsTests.cs
LiveExternalProviderIntegrationTests.cs
GET /api/models, GET /api/ollama/ps, GET /api/hf/search, GET /api/hf/download, GET /api/civitai/search, GET /api/civitai/download.
Workflow APIEndpoints/WorkflowEndpoints.csWorkflowPerformanceTests.csGET /api/comfy/workflows (preset discovery), GET /api/3d/files (GLB/GLTF mesh inspection and serving).
MCP API & Tool SuiteServices/LocalLlmMcpTools.cs
Endpoints/McpEndpoints.cs
Program.cs
McpServerIntegrationTests.csStreamable HTTP / SSE MCP server mapped to /mcp, JSON-RPC 2.0 dispatch, and all 8 AI automation tools.
Root ViewModelLocalLLMServerManager.Shared/ViewModels/MainViewModel.csMainViewModelTests.csMaster coordinator ViewModel aggregating sub-ViewModels, tab switching, global health polling, toast notifications, VRAM unload triggering.
Telemetry ViewModelLocalLLMServerManager.Shared/ViewModels/TelemetryViewModel.csMainViewModelTests.csReactive GPU VRAM percentage calculation, stacked bar allocation, GPU model formatting.
Ollama Library ViewModelLocalLLMServerManager.Shared/ViewModels/OllamaLibraryViewModel.csMainViewModelTests.csInstalled Ollama models, capability profiling (Coding, Reasoning, Math, Chat), interactive KV Cache calculator (up to 32K tokens), model pull SSE stream parsing.
Hugging Face ViewModelLocalLLMServerManager.Shared/ViewModels/HuggingFaceSearchViewModel.csMainViewModelTests.cs
SearchServicesTests.cs
GGUF repository search, branch quantization tree parsing (Q4_K_M, Q5_K_M, Q8_0, FP16), download progress tracking.
CivitAI ViewModelLocalLLMServerManager.Shared/ViewModels/CivitaiSearchViewModel.csMainViewModelTests.cs
SearchServicesTests.cs
CivitAI model gallery, search filters (Checkpoint, LoRA, VAE, ControlNet), download manager.
Settings ViewModelLocalLLMServerManager.Shared/ViewModels/SettingsViewModel.csSettingsViewModelTests.cs
MainViewModelTests.cs
AppSettingsTests.cs
Settings editor for directory paths, URLs, preferred engine toggle, auto-detect tools, file/folder pickers, and real-time status indicators.
Shared ServicesLocalLLMServerManager.Shared/Services/*SearchServicesTests.cs
BrowserLauncherTests.cs
LiveExternalProviderIntegrationTests.cs
CivitaiSearchService, HuggingFaceSearchService, OllamaModelService, TelemetryService, ToastService, BrowserLauncher, ToolDiscoveryService.
Avalonia XAML ViewsLocalLLMServerManager.Shared/Views/*MainWindowUiTests.cs
AvaloniaUiTests.cs
Fluent dark theme controls (MainView, TelemetryHeaderControl, OllamaModelsTabControl, HuggingFaceTabControl, CivitaiTabControl, EngineStudioTabControl, SettingsTabControl).
Static Assets & WASMProgram.cs
LocalLLMServerManager.Web/*
StaticFileMimeTypeTests.cs
PlaywrightWasmE2ETests.cs
Kestrel static file provider MIME mappings (.wasm, .dat, .json, .js, .css, .png, .glb), WebAssembly browser runtime initialization.
Playwright Browser E2ELocalLLMServerManager.Web/wwwroot/*PlaywrightWasmE2ETests.csHeadless Chromium boots WebAssembly client, validates #out DOM container, asserts 0 unhandled console errors, 0 404s on _framework assets.
Screenshot Generatordocs/images/*PlaywrightScreenshotGenerator.csNavigates all 5 tabs in headless Chromium with WebGL SwiftShader, captures crisp screenshots to docs/images/, asserts visual distinctness.
Installer & In-Place Updatesscripts/installer.iss
scripts/install.ps1
scripts/update.ps1
scripts/install_linux.sh
Verified via automated syntax & script lifecycle verificationPre-install process termination (Windows Service / tray app / systemd), configuration preservation (settings.json), post-install reconfiguration and restart.

πŸͺŸπŸ§ Cross-Platform Test Validation Matrix ​

Platform / CapabilityWindows 11 x64Linux (Ubuntu / Debian / Fedora)Verification Details
Process Managementβœ… Win32 Job Objectsβœ… Linux Process Group / SignalsVerified in ServicesAndEngineManagerTests. Win32 memory caps active on Windows; graceful fallback on Linux.
Tool Discoveryβœ… Multi-Drive Roots (C:, D:, E:)βœ… Standard Roots (/opt, ~/.ollama)Verified in ToolDiscoveryServiceTests & DiscoveryEndpointsTests. Scans all connected drive partitions and standard paths.
GPU Telemetryβœ… NVML (nvidia-smi) + Registryβœ… NVML (nvidia-smi) + /proc/meminfoVerified in GpuTelemetryProvider. Returns accurate VRAM bytes and GPU model name across OS boundaries.
Browser Launchingβœ… explorer.exe / cmdβœ… xdg-openVerified in BrowserLauncherTests. Tests verify cross-platform shell execution and fallback handling.
Background Daemonβœ… Windows Serviceβœ… Linux systemd daemonVerified in ServerEndpointsTests and ServerInfrastructureAndAppTests with --service and --headless flags.
Static File MIME Routingβœ… Kestrel Custom Content Typesβœ… Kestrel Custom Content TypesVerified in StaticFileMimeTypeTests. Correctly resolves .wasm (application/wasm) and .glb (model/gltf-binary).
MCP Server & AI Toolsβœ… Streamable HTTP & SSE (/mcp)βœ… Streamable HTTP & SSE (/mcp)Verified in McpServerIntegrationTests with all 8 tools, DI container resolution, and legacy endpoint.
In-Place Upgradesβœ… Inno Setup (.iss) & update.ps1βœ… install_linux.shVerified in installer scripts with pre-install process termination, settings preservation, and post-update service restart.
Playwright Automationβœ… Headless Chromium + SwiftShaderβœ… Headless Chromium + SwiftShaderVerified in PlaywrightWasmE2ETests and PlaywrightScreenshotGenerator.

πŸ“ Test Fixture Inventory (All 20 Test Files) ​

#Test Class FilePrimary FocusTest Count
1AppSettingsTests.csAppSettings default values, environment variable expansion, JSON serialization6
2AvaloniaUiTests.csAvalonia desktop app builder, main window layout, and control initialization3
3BrowserLauncherTests.csCross-platform URL launching (Windows explorer / Linux xdg-open)12
4DiscoveryEndpointsTests.csTool detection and path validation REST Minimal API endpoints8
5EndToEndSystemTests.csFull stack Kestrel Minimal API + YARP reverse proxy system integration3
6LiveExternalProviderIntegrationTests.csLive integration and fallback for Hugging Face and CivitAI endpoints6
7MainViewModelTests.csMainViewModel coordinator reactivity, tabs, toast dispatcher, and VRAM unload13
8MainWindowUiTests.csUI DataContext bindings, UserControl hierarchy, and XAML styles1
9McpServerIntegrationTests.csModel Context Protocol streamable HTTP /mcp endpoint, 8 tools, DI resolution, and error branches22
10PlaywrightScreenshotGenerator.csAutomated Playwright documentation screenshot generator across all 5 tabs1
11PlaywrightWasmE2ETests.csPlaywright E2E browser automation verifying WebAssembly client in Chromium1
12SearchServicesTests.csUnit tests for CivitaiSearchService, HuggingFaceSearchService, OllamaModelService4
13ServerEndpointsTests.csKestrel Minimal API integration tests (/health, /api/gpu/vram, /api/settings, path safety)55
14ServerInfrastructureAndAppTests.csDI container resolution, logging infrastructure, and Win32 Job Object lifecycle1
15ServicesAndEngineManagerTests.csEngine process management, GitUpdateService, and GpuTelemetryProvider parsing4
16SettingsViewModelTests.csSettingsViewModel auto-detect tools, file/folder pickers, and path validation10
17StaticFileMimeTypeTests.csMIME type provider verification for WASM and 3D GLB assets2
18ToolDiscoveryServiceTests.csMulti-drive tool discovery, path validation, and environment expansion14
19VramOrchestratorTests.csVRAM Orchestrator pre-generation memory clearing and health probes7
20WorkflowPerformanceTests.csComfyUI workflow JSON loading, parsing, and GLB export profiling1
Total174 Tests

πŸ› οΈ Best Practices for Developers & Contributors ​

  1. Always run tests in chunks when validating locally to avoid concurrent port collisions on mock HTTP servers.
  2. Ensure Chromium binaries are installed before running Playwright tests:
    powershell
    pwsh LocalLLMServerManager.Tests/bin/Release/net10.0/playwright.ps1 install chromium
  3. Clean up orphaned processes if a test host is forcefully terminated:
    powershell
    Get-Process -Name "*LocalLLMServerManager*", "*testhost*" -ErrorAction SilentlyContinue | Stop-Process -Force

Released under the MIT License.