test(deploy): lock down image build context

This commit is contained in:
leefer
2026-07-30 20:30:49 +08:00
parent c3598820ef
commit 23d11b0d21
3 changed files with 18 additions and 2 deletions
@@ -48,7 +48,7 @@
## 自动质量门
- Ruff:通过
- pytest112项通过
- pytest113项通过
- Vue类型检查:通过
- Vitest7项通过
- Vite生产构建:通过
+1 -1
View File
@@ -72,7 +72,7 @@
- 图表夜间加载首帧、主题同步切换、7板布局和观心夜间关键文字对比度均已有浏览器直接断言,不再只依赖截图。
- 16个主工作区、策略跟踪、提醒、复盘助手、账户/会员及系统管理已逐项区分加载、真实空和失败;统一API客户端不会向页面泄露上游错误正文。
- 后台任务不再把`AppError`内部元组直接展示到系统管理;历史记录读取时兼容清理,新增失败按用户可读说明入库。
- 发布候选`310dbba`本轮复核为Ruff、112项pytest、Vue类型检查、7项Vitest、生产构建和
- 当前主分支本轮复核为Ruff、113项pytest、Vue类型检查、7项Vitest、生产构建和
26项Playwright全部通过。
## 本轮范围外项目
+16
View File
@@ -44,3 +44,19 @@ def test_portainer_preflight_is_pinned_to_the_release_candidate() -> None:
assert "546c5af1a3010bbf0cf37e5d8b1a440fe6dfbfe80b471cddf430d4363a7b1a4a" in manifest
for expected in ("用户 | 3", "自选 | 6", "选股归档 | 107", "策略跟踪 | 16"):
assert expected in manifest
def test_image_context_excludes_private_and_non_runtime_assets() -> None:
ignored = {
line.strip()
for line in ROOT.joinpath(".dockerignore").read_text(encoding="utf-8").splitlines()
if line.strip() and not line.lstrip().startswith("#")
}
assert {".git", ".venv", "data", ".env", "docs/evidence", "tests"} <= ignored
dockerfile = ROOT.joinpath("Dockerfile").read_text(encoding="utf-8")
assert "COPY . " not in dockerfile
assert "COPY backend/ ./backend/" in dockerfile
assert "COPY config/ ./config/" in dockerfile
assert "COPY tools/ ./tools/" in dockerfile
assert "COPY --from=frontend-build /build/frontend/dist ./frontend/dist" in dockerfile