How open-webui/tests works
This repository is an external regression suite for Open WebUI, not the application itself. Its main workflow is to start a scratch instance with controllable dependencies, exercise it through HTTP or a browser, and check observable results; unit and frontend tests cover behavior closer to the source. The README documents these suite layers and their roles. Source excerpts show selected harness implementations, but many test areas are unsampled, so their internal call relationships are not inferred.
Main entry points: instance.py Scratch instance · conftest.py Pytest runner · integration HTTP integration · e2e Browser tests
Components 21
Test execution
- Pytest runner
conftest.py - HTTP integration
integration - Browser tests
e2e - Backend unit tests
unit - Frontend tests
frontend
Scratch instance
- Scratch instance
harness/instance.py - Open WebUI backend
- Scripted model provider
harness/upstream.py - Instance backends
harness/backends.py - Prepared data
harness/prepared_data.py
Test drivers
- API clients
harness/actors.py - Socket client
harness/socket_client.py - Chat UI helpers
utils/chat_ui.py - Chat scripting
harness/chat.py
Harness support
- Mock service listener
harness/listener.py - Audio and image mocks
harness - Object storage mocks
harness/object_storage.py - Redis command stub
integration/fake_redis.py - Stateful Redis
integration/stateful_redis.py - Hash Redis
integration/hash_redis.py - Upgrade data seeding
scripts/seed_upgrade_data.py
Connections 20
- Pytest runner → Scratch instance: boots
README.md - Pytest runner → HTTP integration: runs
README.md - Pytest runner → Browser tests: runs
README.md - Pytest runner → Backend unit tests: runs
README.md - Pytest runner → Frontend tests: runs
README.md - HTTP integration → Scratch instance: drives HTTP
README.md - Browser tests → Scratch instance: drives browser
README.md - Backend unit tests → Open WebUI backend: tests source
README.md - Frontend tests → Open WebUI backend: imports src/lib
README.md - Scratch instance → Open WebUI backend: starts
harness/instance.py - Scratch instance → Scripted model provider: configures
harness/instance.py - Scratch instance → Instance backends: uses
harness/instance.py - HTTP integration → API clients: uses actors
- HTTP integration → Socket client: tests sockets
- Browser tests → Chat UI helpers: drives chat
- Chat scripting → Scripted model provider: scripts replies
harness/chat.py - Mock service listener → Audio and image mocks: serves mocks
harness/audio_engine.py - Upgrade data seeding → Prepared data: creates data
scripts/seed_upgrade_data.py - Stateful Redis → Redis command stub: falls back
integration/stateful_redis.py - Hash Redis → Stateful Redis: extends
integration/hash_redis.py