test(autofix): sync workflow assertions with split model vars - #7297
Conversation
The autofix workflow now plumbs QWEN_AUTOFIX_MODEL (with a QWEN_PR_REVIEW_MODEL fallback) into the report steps, and the prepare step documents the verification gate's git diff --quiet check in a comment. Update the two stale assertions so they match the workflow again without dropping their original intent.
|
Thanks for the PR! Template: the body covers what/why/how-to-verify in prose but skips the template headings ( Problem: confirmed. The two assertions drifted from the workflow after the model variables were split ( Direction: straightforward test maintenance, keeps CI green. No concerns. Size: not applicable — Approach: minimal and correct. Two assertion updates, nothing extra. The Moving on to code review. 🔍 中文说明感谢贡献! 模板:PR 描述用散文覆盖了 what/why/how-to-verify,但缺少模板标题( 问题:已确认。模型变量拆分( 方向:直接的测试维护,保持 CI 绿色。无顾虑。 规模:不适用—— 方案:最小且正确。两个断言更新,没有多余改动。 进入代码审查 🔍 — Qwen Code · qwen3.7-max Reviewed at |
|
Code review — independent proposal first: given the two failures, I'd (1) update the model assertion to the split-variable form the workflow actually uses, and (2) narrow the Both changes are correct:
No correctness issues, no convention violations, no scope creep. The added comment explaining why the assertion targets Testing — this is a test-only change, so the test suite is the real-scenario verification. Before/after: Before (main branch)After (this PR)All 63 tests pass, no regressions. 中文说明代码审查——先独立提出方案:面对这两个失败,我会 (1) 将模型断言更新为工作流实际使用的拆分变量形式,(2) 将 两处改动都正确:
无正确性问题、无规范违反、无范围蔓延。新增的注释解释了为什么断言针对 测试——这是纯测试改动,测试套件本身就是真实场景验证。 Before(main 分支):2 个测试失败。After(本 PR):63/63 全部通过,无回归。 — Qwen Code · qwen3.7-max Reviewed at |
|
Confidence: 5/5 — clean, minimal test fix; verified before/after; would merge without hesitation. This is exactly the kind of PR that should be easy to review and ship. Two assertions drifted from the workflow they guard, the fix realigns them with the current state, and the original intent of both checks is preserved. The diff is 9 lines, the explanation is clear, and the test suite confirms 63/63 pass with no regressions. Nothing to second-guess here. 中文说明置信度:5/5——干净、最小的测试修复;已验证 before/after;毫不犹豫即可合并。 这正是应该容易审查和发布的 PR。两个断言与其守卫的工作流不一致,修复将它们与当前状态重新对齐,两个检查的原始意图都得以保留。diff 9 行,解释清晰,测试套件确认 63/63 通过且无回归。无需犹豫。 — Qwen Code · qwen3.7-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
chiga0
left a comment
There was a problem hiding this comment.
Code Review Overview (AI Generated)
PR: #7297 — test(autofix): sync workflow assertions with split model vars
Type: Test Fix
Change size: +7/-2 across 1 file
HEAD: fc3dd4fe
Findings Summary
- Critical/Major/Minor/Nit: 0
Review
Two clean test assertion realignments:
-
Model assertion:
vars.QWEN_PR_REVIEW_MODEL→vars.QWEN_AUTOFIX_MODEL || vars.QWEN_PR_REVIEW_MODEL. Correctly matches the workflow's split model variable with review-model fallback. -
Build-output assertion:
not.toContain('git diff --quiet')→not.toContain('if git diff --quiet'). Correctly narrows to reject only the executed guard form while allowing the documentation comment occurrence. The original intent (prepare step must restore build output unconditionally) is preserved.
Final Verdict
LGTM. Focused test-only fix that resolves false CI failures without weakening the assertions' original intent.
This review was generated by QoderWork AI
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
Bring the branch up to date with main to pick up the autofix workflow test sync (#7297). The PR branch was behind main, so CI ran the stale scripts/tests/qwen-autofix-workflow.test.js expectations and failed the 'MODEL: ${{ vars.QWEN_AUTOFIX_MODEL || vars.QWEN_PR_REVIEW_MODEL }}' and 'if git diff --quiet' assertions. Merging main resolves those failures. No PR source changes are made by this merge.
|
Released in v0.20.1. |
What this PR does
This realigns two autofix workflow test assertions with the workflow as it stands today. The model assertion now expects the autofix-specific model variable with its review-model fallback, matching what every reporting step actually plumbs in. The build-output assertion now only rejects an executed diff-quiet short-circuit in the prepare step, so a documentation comment that describes the verification gate no longer trips it. The original intent of both checks is preserved: reports must still name the running model, and the prepare step must still restore build output unconditionally rather than gating it on a diff.
Why it's needed
The autofix workflow changed after the model variables were split and a fork-PR remote-tracking ref was added, but these two assertions were not updated alongside it. As a result they fail on any branch that carries the current main, turning CI red for changes that are otherwise unrelated to autofix. Syncing the assertions clears that false failure.
Reviewer Test Plan
How to verify
Run the autofix workflow test suite and confirm the two previously failing cases — the running-model footer check and the build-output-restore check — now pass, with no other case regressing:
Both pass locally. Prettier and ESLint are clean on the changed file.
Evidence (Before & After)
N/A — test-only change, no user-visible behavior.
Tested on
Environment (optional)
Unit tests only (
vitest).Risk & Scope
if git diff --quietinstead of anygit diff --quiet), but that is exactly the executed-guard form it was meant to catch; the comment occurrence is intentionally allowed.Linked Issues
Relates to the CI failure observed on #7251.
中文说明
这个 PR 做了什么
本 PR 把 autofix workflow 的两条测试断言重新对齐到当前 workflow 的实际内容。model 断言现在期望 autofix 专用的 model 变量及其 review-model 兜底,与每个 report 步骤实际注入的内容一致。build-output 断言现在只拒绝 prepare 步骤里真正执行的 diff-quiet 短路,因此描述 verification gate 的那行文档注释不会再误触发它。两条检查的原始意图都保留了:report 仍然必须标出运行所用的模型,prepare 步骤仍然必须无条件恢复构建产物、而不是依据 diff 来决定是否恢复。
为什么需要
在 model 变量被拆分、以及新增了 fork PR 的 remote-tracking ref 之后,autofix workflow 发生了变化,但这两条断言没有同步更新。于是任何携带当前 main 的分支上它们都会失败,让本来与 autofix 无关的改动 CI 变红。同步这两条断言可以消除这个误报。
评审验证计划
如何验证
跑 autofix workflow 测试套件,确认之前失败的两个用例——运行模型 footer 检查和 build-output 恢复检查——现在通过,且没有其它用例回归:
两条本地均通过。改动文件的 Prettier 和 ESLint 均干净。
证据(前后对比)
N/A——仅测试改动,无用户可见行为。
测试环境
环境(可选)
仅单元测试(
vitest)。风险与范围
if git diff --quiet而非任意git diff --quiet),但这正是它原本要抓的「真正执行的短路」形式;注释里的出现是被有意放行的。关联 Issue
与 #7251 上观察到的 CI 失败相关。