Goal
RigForge has no tests (only shellcheck). Bring it to pithead's bar (which sources its script and black-box tests the CLI with docker/sudo stubbed).
Proposed
- Make
rigforge.sh sourceable without side effects — guard main "$@" behind a BASH_SOURCE/_SOURCED check (as pithead does) so functions can be tested in isolation.
- Black-box test the pure logic with
sudo/apt-get/git/make/systemctl/modprobe stubbed on PATH: parse_config, the .local short-hostname handling (:119), DONATION validation, the jq config generation (assert the produced XMRig config), and CPU-profile selection (EPYC / X3D / macOS branches).
- Live under
tests/.
Acceptance
Goal
RigForge has no tests (only shellcheck). Bring it to pithead's bar (which sources its script and black-box tests the CLI with
docker/sudostubbed).Proposed
rigforge.shsourceable without side effects — guardmain "$@"behind aBASH_SOURCE/_SOURCEDcheck (as pithead does) so functions can be tested in isolation.sudo/apt-get/git/make/systemctl/modprobestubbed onPATH:parse_config, the.localshort-hostname handling (:119),DONATIONvalidation, thejqconfig generation (assert the produced XMRig config), and CPU-profile selection (EPYC / X3D / macOS branches).tests/.Acceptance
rigforge.shis sourceable; a test runner exercises the logic above with no real side effects.