fix: 修复测试导入错误、playwright配置、pytest配置
- 修复orchestrator.py check_coverage导入路径 - 修复test_golden.py/test_e2e.py/test_design.py导入错误 - 删除过时test_preprocessor.py - 修复test_confidence.py compare_coverage导入路径 - 修复pytest模块命名冲突(hina/e2e添加__init__.py) - 配置pytest.ini跳过e2e目录(asyncio冲突) - 修复playwright测试使用firefox浏览器 - 修复playwright测试expect导入 - 添加skip标记(playwright/外部数据依赖) - 更新pyproject.toml setuptools配置 - 更新README.md/AGENTS.md/test-report.md文档
This commit is contained in:
@@ -210,26 +210,52 @@ run.py
|
||||
git clone https://gittea.dev/<your-account>/2026Technology-Competition.git
|
||||
cd 2026Technology-Competition
|
||||
|
||||
# 2. 安装 Python 依赖
|
||||
pip install lark pathlib pyyaml
|
||||
# 2. 安装 Python 依赖(完整)
|
||||
pip install lark pathlib pyyaml fastapi uvicorn httpx
|
||||
|
||||
# 3. 验证安装
|
||||
# 3. 安装测试依赖(可选)
|
||||
pip install pytest playwright
|
||||
|
||||
# 4. 安装 Playwright 浏览器驱动(可选,用于 E2E 测试)
|
||||
playwright install chromium
|
||||
|
||||
# 5. 验证安装
|
||||
python -c "from cobol_testgen import extract_structure; print('安装成功')"
|
||||
```
|
||||
|
||||
> **注意**:
|
||||
> - 核心功能只需 `lark pathlib pyyaml`
|
||||
> - Web 服务需要 `fastapi uvicorn`
|
||||
> - E2E 测试需要 `playwright` + 浏览器驱动
|
||||
> - DB 管道需要 `gixsql`(已 vendored 在 `gixsql/` 目录)
|
||||
|
||||
### 运行测试
|
||||
|
||||
```bash
|
||||
# 运行单元测试
|
||||
# 运行所有单元测试
|
||||
python -m pytest tests/ -v
|
||||
|
||||
# 运行核心引擎测试
|
||||
python -m pytest tests/cobol_testgen/ -v
|
||||
|
||||
# 运行非 DB 回归测试
|
||||
python test-data/s15_coverage_verification.py
|
||||
|
||||
# 运行 DB 端到端测试(需设置环境变量,见 SETUP.md)
|
||||
python test-data/s30_db_e2e.py
|
||||
|
||||
# 运行 Web E2E 测试(需安装 playwright)
|
||||
python -m pytest tests/test_web_e2e.py -v
|
||||
|
||||
# 运行业务逻辑 E2E 测试(需安装 playwright + WSL)
|
||||
python -m pytest tests/test_biz_e2e.py -v
|
||||
```
|
||||
|
||||
> **测试说明**:
|
||||
> - 部分测试依赖外部数据(`jcl-cobol-git` 目录),会自动跳过
|
||||
> - E2E 测试需要安装 `playwright` 和浏览器驱动
|
||||
> - Web E2E 测试需要启动 Web 服务:`python -m uvicorn web.api:app --host 127.0.0.1 --port 8000`
|
||||
|
||||
### 使用示例
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user