mirror of
https://github.com/Klipper4FlashForge/firmware.git
synced 2026-10-21 12:52:16 -05:00
Two changes that turned out to be one.
MOVED, NOT DELETED. `test/ffsim/` and `test/integration/printer/` are
`tools/replica/`. They were never tests: bin/patch.sh calls
bin/build-payload.py, which starts a replica and assembles the payload by
running the PRINTER'S OWN opkg against / inside it -- so the "test harness"
was on the build path, and deleting it as asked would have broken `make
build`. qa/lib/replica.py drives the same directory unmodified. No content
changed; what changed is qa/lib/replica.py's build directory, three launcher
sys.path lines, the Makefile targets and the CI shellcheck glob.
tools/replica/README.md says who drives it and why it is not under test/.
CUT TO 28. The five surviving modules were 136 tests; they are 28, chosen on
one question: would this failure be SILENT? What is kept is the mistakes that
run perfectly and are wrong --
test_startup 8 no stamp unless the values are verifiably saved (a
stamp written early is a printer that has lost its
factory calibration for good), and the handover order
test_tool_transform 7 every one is a move to the wrong place: a sign, a
frame left applied while probing, a stale gcode_move
cache, a config a calibrated printer cannot parse
test_ffscreen 5 the four ways it can do harm rather than look wrong
test_chamber 4 the chamber mistakes that cost a print before anyone
sees them, plus the parse gate they rest on
test_gcode 4 a renamed macro, and the safe file being cold
What went: the panel narration, the geometry probe and parse_geometry, the
z_adjust and per-job-Z bookkeeping, the config layout checks, the G-code
bounds checks. Each is either a wrong number shown to a person, or a failure
the printer reports loudly the first time -- and qa/replica/test_boot_screen.py
already renders the real frames on the real machine.
The rewrite is not a delete: assertions were folded so a kept test asks its
question in every direction it can be got wrong (both models, both rotations,
all four ways the migration can fail), and each file's header now says what it
dropped and why, where the next person will open it.
Also gone: conftest's `rootfs` fixture, orphaned two commits ago. Nothing under
test/ needs the firmware, docker, or a network any more.
28 host-side tests pass in 0.15s. qa/static unchanged at 218. `make rootfs`
re-verified end to end from its new path.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UzLebCrvc8ssWR5JuEsha4
25 lines
869 B
Python
25 lines
869 B
Python
"""Where things are, found by looking rather than by counting.
|
|
|
|
Same rule as tools/replica/ffsim/__init__.py, for the reason recorded there:
|
|
the shell suite computed the root by counting `..` from $0, so moving a
|
|
launcher one directory deeper made ROOT point at test/ instead of the repo --
|
|
which happened, to five scripts at once, and shipped. A search does not care
|
|
where the file lives, so this module can move anywhere in the tree.
|
|
"""
|
|
from pathlib import Path
|
|
|
|
# A file that exists in this repo and nowhere above it.
|
|
_MARKER = ("bin", "common.sh")
|
|
|
|
|
|
def repo_root(start=None):
|
|
here = Path(start or __file__).resolve()
|
|
for d in (here,) + tuple(here.parents):
|
|
if d.joinpath(*_MARKER).is_file():
|
|
return d
|
|
raise RuntimeError("not inside the repo: no %s above %s"
|
|
% ("/".join(_MARKER), here))
|
|
|
|
|
|
ROOT = repo_root()
|