-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathtox.ini
More file actions
108 lines (100 loc) · 4.06 KB
/
tox.ini
File metadata and controls
108 lines (100 loc) · 4.06 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
[tox]
requires =
tox>=4.24
tox-uv>=1.20
# coverage env excluded from parallel runs — invoked separately by run_all_tests.sh
env_list = unit, integration, e2e, admin, bdd, ui
skip_missing_interpreters = true
# ─── Base test environment ───────────────────────────────────────
[testenv]
runner = uv-venv-lock-runner
dependency_groups = dev
package = editable
pass_env =
DATABASE_URL
ADCP_SALES_PORT
POSTGRES_PORT
GEMINI_API_KEY
ENCRYPTION_KEY
ADCP_TESTING
ADCP_AUTH_TEST_MODE
CREATE_SAMPLE_DATA
CREATE_DEMO_TENANT
DELIVERY_WEBHOOK_INTERVAL
COMPOSE_PROJECT_NAME
SUPER_ADMIN_EMAILS
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
PYTEST_CURRENT_TEST
setenv =
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
# ─── Unit tests (DATABASE_URL must be UNSET) ────────────────────
[testenv:unit]
description = Unit tests (no database, no server)
setenv =
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
DATABASE_URL =
commands =
pytest tests/unit/ tests/harness/ \
--cov=src --cov-report= \
--json-report --json-report-file={toxworkdir}/unit.json --json-report-indent=2 \
-q --tb=line {posargs}
# ─── Integration tests ──────────────────────────────────────────
[testenv:integration]
description = Integration tests (needs PostgreSQL)
commands =
pytest tests/integration/ \
-m "not requires_server and not skip_ci" \
--cov=src --cov-report= \
--json-report --json-report-file={toxworkdir}/integration.json --json-report-indent=2 \
-q --tb=line {posargs}
# ─── E2E tests ──────────────────────────────────────────────────
[testenv:e2e]
description = End-to-end tests (needs full Docker stack)
commands =
pytest tests/e2e/ \
--cov=src --cov-report= \
--json-report --json-report-file={toxworkdir}/e2e.json --json-report-indent=2 \
-q --tb=line {posargs}
# ─── Admin UI tests ──────────────────────────────────────────────
[testenv:admin]
description = Admin UI tests (needs full Docker stack)
commands =
pytest tests/admin/ \
-m "not requires_server and not slow" \
--cov=src --cov-report= \
--json-report --json-report-file={toxworkdir}/admin.json --json-report-indent=2 \
-q --tb=line {posargs}
# ─── UI smoke tests (Playwright) ───────────────────────────────
[testenv:ui]
description = UI smoke tests via Playwright (needs full Docker stack + browser)
extras = ui-tests
commands_pre =
playwright install chromium
commands =
pytest tests/ui/ \
--browser chromium \
--json-report --json-report-file={toxworkdir}/ui.json --json-report-indent=2 \
-q --tb=short {posargs}
# ─── BDD behavioral tests ──────────────────────────────────────
[testenv:bdd]
description = BDD behavioral tests (pytest-bdd)
commands =
pytest tests/bdd/ \
--cov=src --cov-report= \
--json-report --json-report-file={toxworkdir}/bdd.json --json-report-indent=2 \
-q --tb=line {posargs}
# ─── Coverage combine + report ──────────────────────────────────
[testenv:coverage]
description = Combine coverage from all suites and generate reports
skip_install = true
deps = coverage[toml]
depends = unit, integration, e2e, admin, bdd
parallel_show_output = true
setenv =
COVERAGE_FILE = {toxworkdir}/.coverage
commands =
coverage combine {toxworkdir}
coverage report --fail-under=30
coverage html -d {toxinidir}/htmlcov
coverage json -o {toxinidir}/coverage.json