fix(verify-manual): use a real temp file instead of /dev/stdin for the registry round-trip test
Generate documentation / build-docs (push) Successful in 3m30s

fish 3.7 (Ubuntu 24.04's packaged version, used in CI) rejects
'source /dev/stdin' when it's backed by a pipe, with
"'/dev/stdin' is not a file" -- fish 4.8 (local dev) accepts it.
Writing the generated registry to a real temp file sources
identically across fish versions.
This commit is contained in:
2026-08-18 21:55:23 -04:00
parent df929c5335
commit 0ef99e4874
+13 -3
View File
@@ -1097,8 +1097,16 @@ def test_render_registry_is_valid_fish_and_round_trips():
"""Sourcing render()'s output must leave the two arrays in the exact """Sourcing render()'s output must leave the two arrays in the exact
shape __fish_config_op_registry_lookup expects -- checked via the real shape __fish_config_op_registry_lookup expects -- checked via the real
lookup helper (functions/__fish_config_op_registry_lookup.fish, Task lookup helper (functions/__fish_config_op_registry_lookup.fish, Task
2) rather than re-parsing the generated text by hand.""" 2) rather than re-parsing the generated text by hand.
Written to a real temp file rather than piped through `source
/dev/stdin`: fish 3.7 (Ubuntu 24.04's packaged version, used in CI)
rejects `/dev/stdin` with "is not a file" when it's backed by a pipe,
even though fish 4.8 accepts it -- sourcing an actual file on disk is
the portable form across fish versions.
"""
import subprocess import subprocess
import tempfile
import generate_component_registry as gcr import generate_component_registry as gcr
@@ -1109,14 +1117,16 @@ def test_render_registry_is_valid_fish_and_round_trips():
text = gcr.render(registry) text = gcr.render(registry)
repo = Path(__file__).parent.parent repo = Path(__file__).parent.parent
with tempfile.TemporaryDirectory() as d:
registry_path = Path(d) / "registry.fish"
registry_path.write_text(text)
proc = subprocess.run( proc = subprocess.run(
[ [
"fish", "-c", "fish", "-c",
f"source {repo}/functions/__fish_config_op_registry_lookup.fish; " f"source {repo}/functions/__fish_config_op_registry_lookup.fish; "
"source /dev/stdin; " f"source {registry_path}; "
"__fish_config_op_registry_lookup rm ''; echo status=$status", "__fish_config_op_registry_lookup rm ''; echo status=$status",
], ],
input=text,
capture_output=True, capture_output=True,
text=True, text=True,
) )