test(ci): 新增 pytest 单元测试与最小 CI 门禁
tools/ci_check.py 统一本地与流水线检查:全量 Python 语法编译(py_compile 不落 __pycache__)+ tests/unit 纯逻辑单测,可选 --frontend 追加壳前端构建;.gitlab-ci.yml 在 Windows runner 上复用同一脚本;requirements-dev.txt / pytest.ini 固化测试依赖与用例路径。单测覆盖 XQ0033/0034/0035/0037/0045/0048 的纯逻辑部分。
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# 最小 CI:全量 Python 语法编译 + 插件纯逻辑单测。
|
||||
# 执行环境:Windows runner(项目插件依赖 Windows/COM 场景,单测本身跨平台)。
|
||||
# 本地等价命令:.venv\Scripts\python.exe tools/ci_check.py [--frontend]
|
||||
# 前端构建未纳入默认流水线(需 runner 预装 Node/pnpm 与 node_modules),
|
||||
# 可在本机用 --frontend 单独验证。
|
||||
|
||||
stages:
|
||||
- check
|
||||
|
||||
python-check:
|
||||
stage: check
|
||||
interruptible: true
|
||||
script:
|
||||
- python -m venv .venv
|
||||
- .venv/Scripts/python.exe -m pip install --quiet --upgrade pip
|
||||
- .venv/Scripts/python.exe -m pip install --quiet pytest==9.2.0 openpyxl requests pandas
|
||||
- .venv/Scripts/python.exe tools/ci_check.py
|
||||
cache:
|
||||
key: pip-$CI_COMMIT_REF_SLUG
|
||||
paths:
|
||||
- .venv/
|
||||
Reference in New Issue
Block a user