Files
firmware/test.env.example
T
Oleksandr ShyshatskyiandClaude Opus 5 c185ef3285 The replica is a build tool; test/ is 28 unit tests
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
2026-08-29 23:27:34 +03:00

46 lines
2.1 KiB
Bash

# creator5-custom-firmware -- TEST configuration
#
# cp test.env.example test.env
#
# Nothing in this file ever reaches a printer. It configures the replica --
# the printer's real rootfs under qemu-mipsel -- and nothing else. Build
# inputs and anything that ships live in config.env.
# ---- a prebuilt replica image (START HERE) ---------------------------------
# The fastest and simplest way to run the replica tests: an image that already
# carries the printer's rootfs, its real /usr/prog and /usr/data, AND the
# stock package installed on top of them. With it a replica run starts in
# under a second and PROG_DUMP below is not needed at all.
#
# Without it every run unpacks the 182MB factory image (~22s) and installs the
# stock package under qemu (~37s) before the test even begins.
#
# Built by tools/replica/build-printer-image.sh. It contains proprietary FlashForge
# firmware.
PRINTER_IMAGE="monstrofil/creator5-printer:latest"
# ---- the replica's /usr/prog and /usr/data ---------------------------------
# Only needed when PRINTER_IMAGE is empty -- the image has this baked in.
# Otherwise REQUIRED for every test that runs inside the replica. It is the factory
# image -- the printer's real /usr/prog and /usr/data, giving the replica the
# genuine klipper daemons, nginx, python3, checkEboard, moonraker and, most
# usefully, the printer's own OpenSSL 1.0.2d, so package decryption is
# verified against the real implementation. There are no stubs: if this is
# missing the replica refuses to run rather than test against mocks.
#
# One image serves both models. Either take one off your own machine
#
# ssh root@printer 'tar -cf - /usr/prog' > prog.tar
#
# or use the published factory image
# (md5 d2fdc0e1deb17c41cbb6016d55ab3031):
#
# https://github.com/ghzserg/FF/releases/download/R/Creator5Pro-factory.tar.xz
PROG_DUMP="$HOME/Desktop/Creator5Pro-factory.tar.xz"
# Real partition sizes, as `df -h` reports them on the printer itself.
# Until these are set the replica's prog/data partitions are unbounded, so an
# install that runs the machine out of space would pass here and fail there.
PROG_MB=""
DATA_MB=""