summaryrefslogtreecommitdiff
path: root/tests/helpers.sh
AgeCommit message (Collapse)Author
2026-06-27qr0: timeout + per-destination isolation for rsync sync_distPaul Buetow
Wrap each rsync in sync_dist in run_with_timeout (new SYNC_TIMEOUT config, default 300s) so a hung or unreachable mirror cannot block the whole sync, matching every other external call. Make destinations isolated: under set -euo pipefail a single failing destination used to abort the loop and silently skip the rest. Now each destination runs under a localized set +e (the project's refresh_splash idiom), results are collected per destination, a clear pass/fail summary is logged, and sync returns non-zero if any destination failed while still attempting all of them. SYNC_TIMEOUT is plumbed like TAR_TIMEOUT: shuriken.default.conf, apply_config_defaults, print_config, verbose config log, and positive-integer validation in both validate_config (generate path) and validate_sync_config (sync path). No CLI flag, matching TAR_TIMEOUT. Tests: a sync where one destination fails still attempts the others and exits non-zero with the summary; SYNC_TIMEOUT=0 is rejected as a positive integer. Adds install_rsync_spy_failing_one helper and updates the print_config expected blocks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25Add runtime GNU-tool guard; document Linux-only platform supportPaul Buetow
shuriken shells out to GNU-only features of the standard Unix tools (find -printf, stat -c, cp -a, sort -R). Add require_gnu_tools in a new src/lib/compat.source.sh, sourced early and invoked from main() before any action runs. On invocation it feature-probes each tool in a throwaway temp dir; if any probe fails it prints a clear error naming the offending tool and exits 1, so non-GNU (macOS/BSD) environments fail fast instead of producing broken output. README gains a Platform compatibility section and the requirements line now mentions GNU coreutils/findutils. Tests cover the find and stat rejection paths; the shared test helper that builds a coreutils-without-imagemagick PATH now includes cp and stat (which the guard probes).
2026-06-17on0 remove run_action_body serialization runnerPaul Buetow
Shuriken is a single-process CLI, yet the action layer could serialize 30+ globals plus every function definition (declare -p / declare -f) and pipe them into a fresh "bash -euo pipefail" process to run an action. Production already forced the in-process run_action_body_direct via SHURIKEN_ACTION_BODY_RUNNER, so the serialized-subprocess path was dead in production and only added complexity (a hand-maintained variable list to keep in sync). Per KISS, drop it. - Remove run_action_body_context and the run_action_body dispatcher. - Collapse run_configured_action_body to call the action in-process directly and remove the SHURIKEN_ACTION_BODY_RUNNER indirection in main(). - Move the only genuinely needed isolation into a test-only shim (test::run_action_isolated in tests/helpers.sh) for the generate real-failure test, which must capture a failure status without the in-process errexit abort ending the caller (correct in production, where main runs under errexit). - Update the errexit/status-propagation tests to exercise the direct path. Template-engine serialization is unrelated and left untouched. just test, just shellcheck, just check-generated and git diff --check all pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-169n0 warn on identify failure instead of caching empty EXIFPaul Buetow
cached_photo_identify_output() swallowed all ImageMagick errors with 'imagemagick_identify ... || true', so a corrupt photo or identify failure left the cache with only the signature line and no EXIF. That signature-only file was a valid-looking cache hit, so the photo rendered with empty tooltip/stats and the failure was never retried or warned about again. Now capture identify's exit status; on failure, log_warning naming the photo and rm -f the cache file so the next run retries instead of reusing an empty result. The function still returns 0 so one unreadable photo does not abort generation (it runs in backgrounded render jobs under set -euo pipefail) -- the photo just renders without EXIF, now with a warning. Adds tests/cli.sh test_generate_warns_and_skips_cache_on_identify_failure and a TEST_IMAGEMAGICK_IDENTIFY_FAIL hook in the fake ImageMagick to drive a failing identify; asserts exit 0, a warning naming the photo, the photo still rendered, and that the failed photo's cache is absent while a successful photo's cache is present. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13Stabilize template parallelism test for em0Paul Buetow
2026-06-11Rename photoalbum to shurikenPaul Buetow
2026-06-11Parallelize template rendering jobsPaul Buetow
2026-06-06Test identify concurrency limitPaul Buetow
2026-06-06Cache EXIF details between generationsPaul Buetow
2026-06-06Clarify render logs and interrupt cleanupPaul Buetow
2026-06-05Add rsync sync commandPaul Buetow
2026-06-05Enable strict mode for test helpersPaul Buetow
2026-06-05Use wait -n for image job throttlingPaul Buetow
2026-06-05Fix staged generation signal cleanupPaul Buetow
2026-06-05Add timeouts for generation toolsPaul Buetow
2026-06-05Retire Makefile and parallelize image processingPaul Buetow
2026-06-05Add splash page support for task 8j0Paul Buetow
2026-06-04Add image details pages for task 9j0Paul Buetow
2026-06-03Fix TAR_OPTS argv handling for si0Paul Buetow
2026-06-03Add dry-run mode for photoalbum generation (wi0)Paul Buetow
2026-06-03Stage album generation before dist replacePaul Buetow
Task: yi0
2026-06-02Add modern CLI test coverage for pi0Paul Buetow