Make docs.bzl tests easier to understand and extend

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

维护者通常 1 天内回复

@MaximilianSoerenPollak 已经在做这个了。

开始于 2026年11月23日。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
python

调研方向

Start with the docs_bzl test suite: the scenario directories with _expected/ golden samples, each scenario's BUILD and source documents, the central catalog that maps golden cases to Bazel targets, and the harness code that overwrites samples on mismatch. The reference_integration scenario is the representative composition to map. Done means a guide that explains when to use golden samples versus explicit assertions and when to extend the reference integration versus add a focused scenario, plus a clearer mapping of existing tests to the requirements they protect.

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

描述

Problem statement

Overview

It is hard to tell what the docs_bzl tests cover or where to add a new test. Developers have to inspect several files and understand the test harness to work out what a test is meant to protect. We need clear test names and guidance on when to compare output with saved expected files (golden samples), when to write explicit assertions, and where new test cases belong.

Details

The docs_bzl tests cover important behavior, but it is difficult to determine which test protects which requirement and how to add new coverage.

The suite combines explicit Python assertions with golden samples stored in scenario _expected/ directories. Their relationship is unclear: which behavior is covered by the golden samples, which requires explicit assertions, and when should a new test use either approach?

Golden cases are discovered automatically from _expected/ and mapped to Bazel targets through a central catalog. Understanding what they actually protect requires inspecting the scenario’s BUILD, source documents, expected files, and harness code. The resulting test names identify a scenario and output rather than a behavioral expectation. When output differs, the test overwrites the golden samples and fails; reviewing that change requires understanding which differences matter to the scenario’s purpose.

Explicit tests introduce further difficulty:

  • Some check several distinct behaviors under one name.
  • Authors need to know internal Bazel targets, output paths, and helper conventions.
  • Failure assertions vary; some only establish that a build failed, without checking the reason.

reference_integration intentionally approximates the S-CORE setup, including platform requirements, legacy and modern modules, and nested components. This representative composition is valuable and should remain covered; its purpose and the expectations attached to it need to be easier to understand.

Desired outcome

Developers should be able to identify existing coverage and add tests without reverse-engineering the harness. This includes clear guidance on using and reviewing _expected golden samples, writing explicit assertions, and choosing between extending the reference integration and adding a focused scenario.

主要语言
Python
星标
11
派生
39
平均合并
1 天 13 小时
30 天内合并 PR
65

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

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

从这里开始

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

eclipse-score/docs-as-code 的其他 Issue

查看 eclipse-score/docs-as-code 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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