test(ci): L3 golden 进 CI(components+auth 子集,Linux 权威基线)

L3 视觉回归真进 CI(此前卡 docker daemon 未起 + dirty 纠缠;现启 Docker 落地干净子集):
- 在 ghcr.io/cirruslabs/flutter 容器重生成 components+auth 的 14 张 Linux 权威基线
  (auth_login/connect 三态/quota/smart_card;mac 渲染与 CI Linux 不一致,故钉死 Linux),
  容器内 --update-goldens 后无 flag 复跑幂等通过
- ci.yml 新增 golden job(第9个):flutter test components_golden_test + auth_redesign_golden_test
- 解耦干净:这俩只 import clean widget;stats-overhaul 的 l10n 改动纯新增(现有键未动)
  → 渲染不受影响、不裹挟 dirty;tablet/desktop-stats golden 仍耦合 stats-overhaul,待合并后并入
- docs/test-architecture.html:L3 状态更新为「已进 CI(子集)」

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-25 13:20:55 +08:00
parent 63bb31066f
commit bb2688cede
16 changed files with 18 additions and 1 deletions
+17
View File
@@ -143,3 +143,20 @@ jobs:
-v "$PWD:/repo" -w /repo \
golang:1.25 \
bash -c "apt-get update -qq && apt-get install -y -qq openssl curl python3 >/dev/null 2>&1 && bash scripts/e2e-smoke.sh"
# ── Job 9: Golden 视觉回归 (L3 子集:components + auth)──────────────────
# Linux 权威基线(scripts/update-goldens.sh 生成;mac 渲染不一致故钉死 Linux 容器)。
# tablet/desktop-stats golden 与 stats-overhaul 工作区耦合,待其合并后并入本 job。
golden:
name: Golden — 视觉回归 (components + auth)
runs-on: nas
steps:
- name: Checkout
uses: actions/checkout@v4
- name: flutter test golden (Linux 权威基线)
run: |
docker run --rm \
-v "$PWD/client:/app" -w /app \
ghcr.io/cirruslabs/flutter:stable \
bash -c "flutter pub get && flutter test test/golden/components_golden_test.dart test/golden/auth_redesign_golden_test.dart"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

+1 -1
View File
@@ -260,7 +260,7 @@
<li><b>测什么</b>mobile/tablet/desktop × light/dark × zh/en 的渲染一致;以及实现 vs HTML 原型的像素差。</li>
<li><b>工具</b>Flutter golden<code>flutter_test_config.dart</code> 字体锁定→host 无关,所以「每端效果一致」天然成立);design-distill <code>shoot-prototype.mjs</code> + <code>diff.mjs</code>pixelmatch)。</li>
<li><b>量化</b>:像素不一致比例 vs 阈值 <code>0.05</code></li>
<li><b>现状</b><span class="tag t-ok">20+ golden 基准已有</span> <span class="tag t-warn">权威环境脚本 <code>scripts/update-goldens.sh</code> 已备</span> <span class="tag t-bad">CI 硬闸未启</span>。启用前置:① 有 docker 的机器<code>update-goldens.sh</code> 提交一套 Linux 权威基线(mac 基线在 CI 必全红)② stats-overhaul dirty 工作区合并、基线落定 → 再加 <code>flutter test test/golden</code> CI job 转阻塞</li>
<li><b>现状</b><span class="tag t-ok">已进 CI(子集)</span> components + auth golden 跑 Linux 权威基线、CI job <code>golden</code> 阻塞守门;权威环境脚本 <code>scripts/update-goldens.sh</code><span class="tag t-warn">tablet/desktop-stats golden 待并入</span>——它们与 stats-overhaul dirty 工作区耦合(基线/测试/被测 widget 同在 dirty),待其合并后<code>update-goldens.sh</code> 生成 Linux 基线并加进 <code>golden</code> job</li>
<li><b>可自定义</b>:新增屏 = 加一张基线;阈值按屏可调。</li>
</ul>
</div>