Fix failing ci tests

This commit is contained in:
dabao1955
2026-09-22 11:20:22 +08:00
parent 1dc1d9b707
commit b0ff2605fd
3 changed files with 32 additions and 1 deletions
@@ -83,6 +83,30 @@ def test_a_bare_name_after_a_cd_in_the_same_block_is_not_drift(gate):
assert "workbench-after-cd" in kinds, findings
def test_the_external_dcc_entry_point_is_never_drift(gate):
"""`python dcc.py` after `cd tools/_work/bench/repos/dcc` runs inside the external dcc
checkout, so it is a skip on every machine -- including one without the workbench.
The name is declared in EXTERNAL_SCRIPTS because the workbench-name recognition that
used to cover it needs tools/ to exist: on a clean checkout `dcc.py` degraded from
workbench-after-cd to missing-script drift, and the gate failed away from the machine
that wrote the record.
"""
doc = str(REPO_ROOT / "docs" / "tool-verification" / "EXTENSION-java2c.md")
_path, why = gate.resolve_script("dcc.py", doc, include_workbench=False, chdir=True)
if gate._workbench_names():
assert why == "workbench-after-cd", why
else:
assert why == "external", why
text = "```\n$ cd tools/_work/bench/repos/dcc\n$ python dcc.py --no-build\n```\n"
findings = gate.command_findings(doc, text, {}, False)
kinds = [f["kind"] for f in findings]
assert "missing-script" not in kinds, findings
assert "unqualified-workbench" not in kinds, findings
assert any(k in ("workbench-after-cd", "external") for k in kinds), findings
def test_a_shipped_script_resolves_from_the_repository_root(gate):
"""The order that matters: root, then the skill's scripts, then the document's own directory."""
doc = str(REPO_ROOT / "docs" / "tool-verification" / "README.md")