Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
134 lines (127 loc) · 5.35 KB
/
Copy pathpyproject.toml
File metadata and controls
134 lines (127 loc) · 5.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
[project]
name = "open-webui-tests"
version = "0.1.0"
description = "External test suite for Open WebUI — unit (source-level), API integration, and end-to-end browser tests"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "BSD-3-Clause" }
dependencies = [
"pytest~=8.4.1",
"pytest-asyncio>=0.23.0",
"pytest-playwright>=0.5.0",
"playwright==1.60.0",
"pytest-html>=4.0.0",
"pytest-split>=0.11.0",
"pytest-timeout>=2.3.1",
"allure-pytest>=2.13.0",
"httpx==0.28.1",
"python-dotenv>=1.0.0",
# Imported at load time by the harness and the integration and browser
# tests, so the suite collects against an instance without the Open WebUI
# source installed. Unpinned, so a shared environment keeps Open WebUI's versions.
"aiohttp",
"av",
"bcrypt",
"brotli",
"cryptography",
"googleapis-common-protos",
"grpcio",
"ldap3",
"mcp",
"numpy",
"openai",
"opentelemetry-proto",
"packaging",
"pillow",
"protobuf",
"psutil",
"psycopg[binary]",
"pyasn1",
"pycrdt",
"pydantic",
"PyJWT",
"pymilvus",
"pyotp",
"pypdf",
"python-engineio",
"python-socketio",
"redis",
"soundfile",
"sqlalchemy",
"tokenizers",
"uvicorn",
"weaviate-client",
"websockets",
]
# This is a test suite, not an importable library: tell setuptools there
# are no packages to build so `pip install -e .` installs deps + metadata
# without choking on the flat unit/ integration/ e2e/ layout.
[tool.setuptools]
py-modules = []
[project.optional-dependencies]
# Embedded PostgreSQL for the migration tests that run against a real
# postgres (unit/migrations/*). Tests skip cleanly when it's absent.
postgres = [
"pgserver>=0.1.4",
]
dev = [
"ruff>=0.1.0",
"mypy>=1.0.0",
"pgserver>=0.1.4",
]
[tool.pytest.ini_options]
testpaths = ["unit", "integration", "e2e"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
# Tests opt in with an explicit @pytest.mark.asyncio (strict mode).
asyncio_mode = "strict"
# anyio's to_process worker pool is keyed per event loop and its idle-worker
# entries do not survive pytest-asyncio's session loop teardown between
# modules, so a second to_process.run_sync raises BrokenWorkerProcess. dev's
# recurrence helpers now evaluate RRULEs in such workers, so a fresh loop per
# test is required for every async test that reaches one.
# (The pooled aiosqlite rationale for "session" no longer applies since the
# async db tests moved to their own fixtures.)
asyncio_default_test_loop_scope = "function"
markers = [
# ── purpose ────────────────────────────────────────────────────────────
"regression: pinned to a specific upstream issue/PR; fails only if that bug returns",
"journey: broad baseline coverage of a feature, not pinned to one issue",
# ── cost ───────────────────────────────────────────────────────────────
"slow: long-running (comprehensive scans, real postgres boot). Deselect with -m 'not slow'",
# ── scope / auth (browser + API tests) ─────────────────────────────────
"public: public pages, no authentication",
"auth_required: requires an authenticated user session",
"admin_required: requires an admin session",
"api: API-level test via httpx, no browser",
"real_socket_timing: page_for pages get a new chat's socket events unheld, for a bug in that race (e2e)",
"chat_surfaces: the places a test that opens its chat with chat_for runs in, in place of the main chat and a side chat (e2e)",
"secure_context: the test's browsers open the loopback address, a secure context, for a feature the browser offers only there (e2e)",
# ── area (set at collection, by path) ──────────────────────────────────
"terminal: a test of a terminal module: under a terminals/ directory, or with terminal or tether in its file name",
"full_terminal: a test that asks for the full Open Terminal image (full_open_terminal, full_terminal_image); set at collection",
# ── dependency contract tests (unit/deps/) ─────────────────────────────
"depcheck: per-dependency API-surface / usage contract test (run after a bump)",
# ── capability (positive selection; tests also auto-skip when unmet) ────
"requires_source: needs the open-webui backend source checkout (OPEN_WEBUI_SOURCE_DIR)",
"requires_instance: needs an Open WebUI you started yourself at OPEN_WEBUI_URL",
"requires_browser: needs Playwright browsers (e2e)",
"requires_postgres: needs the pgserver package (embedded PostgreSQL)",
]
# a stuck test fails with its name and stack before the CI job's limit; the slowest takes about 4 min
timeout = 600
addopts = [
"--tb=short",
"--strict-markers",
"--strict-config",
]
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "W"]
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true