Commit 18d0695
Showcase Smoke 的上传步骤配的是 examples/app-showcase/playwright-report/,
而这个目录在 CI 下从来不会被创建 —— examples/app-showcase/playwright.config.ts
的 reporter 是 `[['github'], ['list']]`(实测 CI=1 求值),两个都只写 stdout,
没有 html reporter。于是不是「路径写偏了一层」,而是「路径指向一个不存在的
产物」。加上 upload-artifact 的 `if-no-files-found` 缺省为 warn,错配只降成
一条 warning:run 30796529117(2026-08-03,3 failed)的日志里是
##[warning]No files were found with the provided path:
examples/app-showcase/playwright-report/. No artifacts will be uploaded.
该 run 的 artifacts 总数为 0,上传步骤自身仍判绿 —— 每一次失败的截图、trace、
error-context 都随 runner 回收丢掉,这正是一个半数失败的探针长期无从定位的
直接原因。
改动(仅本 workflow 文件):
- 上传路径改为 examples/app-showcase/test-results/ —— 由 Playwright 自己解析
确认的 outputDir 绝对路径落点(config 未声明 outputDir,取默认值并按 config
所在目录解析);upload-artifact 的 `path` 按仓库根解析,故保留完整前缀。
未把 playwright-report/ 一并列上:它今天不可能有内容,列上等于留一条永远
为空的死声明。补 html reporter 属 config 面改动,已另行立单。
- 失败路径 `if-no-files-found: error`,并把前提从宽泛的 `failure()` 收窄到
`steps.smoke.outcome == 'failure'`:smoke 失败就一定留下了证据,空的
test-results/ 本身该报警;而更早的步骤倒下时本就无物可收,不该再叠一条
误导性的红。条件保留 `failure()` 是因为不含状态函数的 `if:` 会被套上隐式
`success()`,那样条件永远为假。
- 新增一条绿色路径上传(`ignore`,不会把夜跑弄红):CI 下 `retries: 1`,
「重试后才绿」的 run 会在 test-results/…-retry1/ 留下第一次尝试的 trace,
而那恰是第 1 缺陷最需要的证据 —— 只在 red 时收会永远错过 flaky-green。
验证边界:workflow 无法本地执行。已做 YAML 解析 + 步骤断言、
pnpm check:workflow-status-functions、pnpm check:nul-bytes,并用 Playwright
自身求值确认 outputDir/reporter/retries;真实产物验证发生在下一次夜跑。
本 PR 只修第 2 缺陷,不动探测条件与 spec 文件,故不 Close 本单。
Claude-Session: https://claude.ai/code/session_01GX3sL71LFq8m2usg6VqTSE
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7adc841 commit 18d0695
1 file changed
Lines changed: 40 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
52 | 75 | | |
53 | 76 | | |
54 | | - | |
55 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
56 | 92 | | |
0 commit comments