Spec environment fixtures duplicate skeleton data that no spec reads
还没有人认领这个 Issue。
评估
调研方向
从 spec/lib/simp/cli/commands/files/environments/ 下的 fixtures 和提到的三个 spec 开始:simp_puppet_env_helper_spec.rb、set_site_scenario_action_spec.rb 和 cli_simp_scenario_spec.rb。检查它们依赖哪些布局、hiera.yaml、manifests/site.pp 和场景文件名;将未使用的 YAML 值精简为占位符或断言过的键。完成标准是这些 spec 仍然通过,并且 fixtures 不再重复未使用的骨架数据。
由索引模型根据 Issue 内容生成。
描述
The environment fixtures under spec/lib/simp/cli/commands/files/environments/ (simp/ and simp_hiera3/) are hand-copied from simp/simp-environment-skeleton. The specs that use them (simp_puppet_env_helper_spec.rb, set_site_scenario_action_spec.rb, cli_simp_scenario_spec.rb) copy the directories into a temp environment. They depend on the layout (data/ vs. hieradata/, hiera.yaml), on manifests/site.pp, and on which scenario files exist. No spec reads the Hiera values in the scenario or host files.
So every data change in the skeleton needs a matching manual edit here, even though no test can tell whether it was made. #237 changed six fixture files only to follow simp/simp-environment-skeleton#76 (haveged → rngd), and the copies have drifted anyway (#236).
Options:
- Cut the fixtures down to what the specs need. Keep the directory layout,
hiera.yaml,site.ppand the scenario file names, and replace the YAML contents with a minimal placeholder (or only the keys a spec actually asserts). Skeleton data changes then never touch this repo. This also makes #236 unnecessary. - Build the fixtures from the skeleton at test time, e.g. from the
simp-environment-skeletonRPM or a pinned checkout. That keeps them accurate, but it adds a network or package dependency to unit tests, so it's probably not worth it.
The first option looks like the better fit. The simp_hiera3/ copy has no current skeleton to follow anyway, so it can be trimmed the same way.
- 主要语言
- Ruby
- 星标
- 2
- 派生
- 12
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
simp/rubygem-simp-cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
simp/rubygem-simp-cli#236 ·
-
simp config: write sssd::domains_entries instead of the deprecated sssd::domains可能已有人在做 @silug 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
simp/rubygem-simp-cli#227 ·
-
难度 4/5 3-5 天 新手友好度 35/100
simp/rubygem-simp-cli#234 ·
-
needs-attention
难度 5/5 一周以上 新手友好度 30/100
simp/rubygem-simp-cli#223 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
simp/rubygem-simp-cli#200 ·
查看 simp/rubygem-simp-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
simp/pupmod-simp-pki#163 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
resend/resend-ruby#266 ·
维护者通常 5 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
SeleniumHQ/selenium#18323 ·
维护者通常 1 天内回复
-
Bug Ruby
难度 2/5 1-3 小时 新手友好度 76/100
getsentry/sentry-ruby#3211 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
danbooru/fumimi-discord#63 ·