auto-sync: 2026-06-08 23:37:25

This commit is contained in:
cfdaily
2026-06-08 23:37:25 +08:00
parent 12f03e48a4
commit 339519a062
3 changed files with 15 additions and 4 deletions
+4 -3
View File
@@ -11,9 +11,10 @@
| 场景 | 命令 | 耗时 | 说明 |
|------|------|------|------|
| **改了某个模块** | `pytest tests/unit/test_spawner.py` | <5s | 只跑改动的模块对应的单元测试 |
| **改了 API 层** | `pytest tests/integration/` | ~1min | 跑全部集成测试 |
| **提交前快速验证** | `pytest -m "not e2e"` | ~2min | 不跑 E2E,验证不破坏现有功能 |
| **部署前全量验证** | `RUN_INTEGRATION=1 pytest` | ~60min | 含 E2E,真实 Agent |
| **改了 API 层** | `RUN_INTEGRATION=1 pytest tests/integration/` | ~1min | 跑全部集成测试 |
| **提交前快速验证** | `pytest` | ~2min | 默认排除 integration 和 e2e |
| **含集成测试** | `RUN_INTEGRATION=1 pytest` | ~5min | integration 测试 |
| **部署前全量验证** | `RUN_INTEGRATION=1 pytest` | ~60min | 含 e2e,真实 Agent |
| **只跑 E2E 场景** | `RUN_INTEGRATION=1 pytest tests/e2e/test_e2e_scenarios.py` | ~30min | 串行,一个跑完再下一个 |
| **只跑 E2E 压力** | `RUN_INTEGRATION=1 pytest tests/e2e/test_e2e_stress.py` | ~10min | 并发测试 |
+3 -1
View File
@@ -8,8 +8,10 @@ requires-python = ">=3.9"
asyncio_mode = "auto"
testpaths = ["tests"]
markers = [
"integration: real agent tests (requires RUN_INTEGRATION=1)",
"integration: integration tests (requires RUN_INTEGRATION=1)",
"e2e: end-to-end tests with real daemon + Agent (requires RUN_INTEGRATION=1)",
]
addopts = "-m 'not integration and not e2e'"
[tool.pyright]
venvPath = "."
+8
View File
@@ -55,6 +55,14 @@ def client_with_isolation(isolated_data_root):
# ── E2E gate ──
def pytest_collection_modifyitems(config, items):
if not os.environ.get("RUN_INTEGRATION"):
skip = pytest.mark.skip(reason="needs RUN_INTEGRATION=1")
for item in items:
if "integration" in item.keywords or "e2e" in item.keywords:
item.add_marker(skip)
skip_no_integration = pytest.mark.skipif(
not os.environ.get("RUN_INTEGRATION"),
reason="Set RUN_INTEGRATION=1 to run E2E tests against real daemon",