From 840585ffc6f879b3e48e508a36da10471025e142 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 14 Jun 2026 23:21:41 +0300 Subject: rm0 surface stats page in the dry-run plan Review follow-up: collect_dry_run_plan stored plan["stats_page"] but print_dry_run_plan never rendered it, so --dry-run gave no signal about the STATS_PAGE toggle or the stats/camera pages generate() would write (dead assignment, breaking parity with splash_page). Print a "Stats page: " line and, when enabled, list stats.html and camera-*.html under "Planned generated files" (camera pages are a wildcard since dry-run does not run EXIF aggregation). Add a --dry-run --no-stats test asserting the stats plan is omitted, and extend the existing dry-run test to assert the stats lines when enabled. Co-Authored-By: Claude Opus 4.8 --- tests/cli.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'tests') diff --git a/tests/cli.sh b/tests/cli.sh index 6f56dad..a78741a 100755 --- a/tests/cli.sh +++ b/tests/cli.sh @@ -1838,6 +1838,7 @@ test_dry_run_reports_cli_overrides_without_writes() { test::assert_contains 'Random seed: dry-seed' "$output" test::assert_contains 'Shuffle: yes' "$output" test::assert_contains 'Splash page: no' "$output" + test::assert_contains 'Stats page: yes' "$output" test::assert_contains 'Image count: 6' "$output" test::assert_contains 'Tarball setting: yes' "$output" test::assert_contains 'Tarball name plan: incoming-.tar' \ @@ -1864,6 +1865,9 @@ test_dry_run_reports_cli_overrides_without_writes() { test::assert_contains \ " $dist_dir/[redirect].html (14 navigation redirects)" \ "$output" + test::assert_contains " $dist_dir/stats.html (EXIF stats page)" "$output" + test::assert_contains " $dist_dir/camera-*.html (per-camera pages)" \ + "$output" test::assert_not_contains "$dist_dir/html" "$output" test::assert_contains " $dist_dir/incoming-.tar" "$output" test::assert_not_contains 'Processing ' "$output" @@ -1875,6 +1879,35 @@ test_dry_run_reports_cli_overrides_without_writes() { test::teardown } +test_dry_run_no_stats_omits_stats_plan() { + local config_file + local dist_dir + local fake_bin + local output + + test::setup + fake_bin="$TEST_TMPDIR/bin" + config_file="$TEST_TMPDIR/shuriken.conf" + dist_dir="$TEST_TMPDIR/dist" + + test::install_fake_imagemagick "$fake_bin" + PATH="$fake_bin:$PATH" \ + test::generate_fixture_images "$TEST_TMPDIR/incoming" + test::write_album_config \ + "$config_file" "$TEST_TMPDIR/incoming" "$dist_dir" 'Dry no stats' 40 + + output=$( + cd "$TEST_TMPDIR" + PATH="$fake_bin:$PATH" "$TEST_SHURIKEN" --dry-run --no-stats + ) + + test::assert_contains 'Stats page: no' "$output" + test::assert_not_contains 'stats.html (EXIF stats page)' "$output" + test::assert_not_contains 'camera-*.html (per-camera pages)' "$output" + test::assert_path_absent "$dist_dir" + test::teardown +} + test_dry_run_reports_empty_plan_without_writes() { local config_file local dist_dir @@ -5506,6 +5539,9 @@ main() { test::run_case \ '--dry-run reports CLI overrides without writes' \ test_dry_run_reports_cli_overrides_without_writes + test::run_case \ + '--dry-run --no-stats omits stats from the plan' \ + test_dry_run_no_stats_omits_stats_plan test::run_case \ '--dry-run reports empty plan without writes' \ test_dry_run_reports_empty_plan_without_writes -- cgit v1.2.3