Gate toolchain e2e suites through one common::toolchain_gate: ten `*_E2E_REQUIRED` readers disagree on whether `=0` and `=true` mean required

未关闭
#1,940 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
testing-qa

调研方向

Start with the ten hand-written required and skip helpers under crates/socket-patch-cli/tests. The table in the issue lists the main ones, such as cargo_e2e_matrix/mod.rs and docker_e2e_sbt.rs. Create tests/common/toolchain_gate.rs with one truthiness rule, then point each suite at it while keeping its env var name. Done means grep -rn "fn required" crates/socket-patch-cli/tests finds only the gate, the unit test covers "", 0, 1, true and false, and the CI values of 1 still fail on a missing tool.

由索引模型根据 Issue 内容生成。

描述

agent:triaged arch-audit priority:p3 refactor

[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.

Kind: refactor. Register ID: T50.

Problem

Each toolchain-backed e2e suite skips locally and must fail on its CI leg when SOCKET_PATCH_<TOOL>_E2E_REQUIRED is set. The "is it required" reader is hand-written per suite (15 fn required and 8 fn skip( definitions under crates/socket-patch-cli/tests), and the readers have drifted on what counts as set:

Copy Rule =0 =true
cargo_e2e_matrix/mod.rs L67-L69 non-empty and != "0" not required required
golang_e2e_matrix/mod.rs L58-L60 any non-empty required required
sbt_e2e_shared/mod.rs L178-L185,``` npm_e2e_common/mod.rs L59-L80, maven_build_common/mod.rs L95-L102 any set / non-empty required required
e2e_nuget_dotnet_build.rs L83-L85,````` e2e_vex_build/deno.rs L57-L59 var_os non-empty required required
vex_e2e_common/uv.rs L106-L110,`````` common/bundler_e2e.rs L95-L97 "1" or true not required required
docker_e2e_sbt.rs L440-L442 exactly "1" not required not required

So SOCKET_PATCH_DOCKER_E2E_REQUIRED=true silently lets the docker leg skip, and =0 turns golang/sbt/npm/maven/nuget/deno into hard failures while cargo/uv/bundler treat it as off. The matching skip(suite, why) (assert-not-required, print SKIP, return true) is copied 7× (cargo, uv, maven, sbt_vendor, yarn_classic_vex, npm_e2e, poetry).

Proposed change

Add tests/common/toolchain_gate.rs with required(var) -> bool (one truthiness rule; suggest the cargo one: non-empty and not 0/false) and skip(var, suite, why) -> bool. Point each suite's required()/skip() at it and delete the copies. Keep each suite's env var name.

Size

~12 test files, roughly −150/+40 lines. No product code.

Acceptance criteria
  • Every CI leg that sets *_REQUIRED=1 today still fails on a missing tool (ci.yml values are all 1).
  • A unit test in common/toolchain_gate.rs pins "", 0, 1, true, false.
  • grep -rn "fn required" crates/socket-patch-cli/tests finds only the gate.
主要语言
Rust
星标
9
派生
2
平均合并
1 天 8 小时
30 天内合并 PR
309

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SocketDev/socket-patch 的其他 Issue

查看 SocketDev/socket-patch 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。