Repository navigation
ci: 在 push / PR 上运行后端测试套件 - #151
Merged
Merged
Conversation
The repository only had a tag-triggered desktop build workflow, so nothing ever executed pytest. That is how a stale test file could abort collection and sixteen tests could stay red on main with nobody noticing. Add a Tests workflow (ubuntu + windows, Python 3.12) and declare the test dependencies in requirements-dev.txt: pytest and pytest-asyncio were not listed anywhere, so every contributor had to discover and install them by hand before the suite would even start.
Contributor
Author
合并后验证(本地)把本工作流依赖的四个修复分支在本地做 octopus merge,然后连续跑两次全量测试: (环境:Windows 11 + Python 3.12.10,无 合并顺序建议 #150 → #147/#148/#149(任意顺序)→ 本 PR,这样 CI 第一次跑就是绿的。若 #150 先合,本 PR 的 ubuntu/windows 两条腿应直接通过;届时若仍有失败,就是真实回归。 顺带记录一个来自本 PR 首次 CI 的结论: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
仓库只有
.github/workflows/build-desktop.yml(打 tag 时构建 PyInstaller 桌面包),没有任何工作流执行pytest,所以 main 上同时存在「收集阶段直接中断」和 16 项失败而无人发现(见 #146)。本 PR:
.github/workflows/tests.ymlmain+ 所有pull_request+workflow_dispatchubuntu-latest与windows-latest(Windows 是桌面版目标平台,POSIX 假设的回归必须同样暴露),Python 3.12PYTHONIOENCODING=utf-8:中文断言/日志在 Windows 默认代码页下会乱码requirements-dev.txtpytest/pytest-asyncio此前没有声明在任何依赖文件里,贡献者必须自己发现并手装,否则连收集阶段都过不去。合并顺序说明
这个 PR 单独合并后第一次 CI 会是红的,因为 main 当前还有 16 红 + 1 收集错误。配套修复已经同时提交,建议按下面顺序合并(互不冲突,可分别 review):
backend/modules/compression覆盖(消除收集错误)这四项合并后,本工作流在 ubuntu 与 windows 上应全绿;若仍有失败,就是真的回归——这正是加 CI 的目的。
变更类型
相关 Issue
关闭 #146
测试
.\.venv\Scripts\python.exe -m pip install -r requirements-dev.txt→ 解析通过(--dry-run无冲突)jobs.pytest存在)pip install -r requirements-dev.txt在 ubuntu / windows 上都能装完(pywebview、pythonnet等没有阻塞 Linux 安装),且工作流本身可用。python -m pytest tests -q→ 收集阶段中断(1 error);--ignore=tests/test_history_compactor.py→ 678 passed / 16 failed。四个修复 PR 合并后(见下方评论)连续两次python -m pytest tests -q→ 708 passed / 0 failed检查清单
build-desktop.yml的 checkout@v4 / 步骤命名风格)requirements-dev.txt,CI 自身即文档)附加信息
顺带发现但未在本次处理的问题:
frontend/package.json的build只跑vite build,type-check/build:check闲置,当前有 60 处既有 TS 错误。建议单独开 issue 清理后再纳入 CI,避免本 PR 同时引入一个长期红的前端检查。