diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-14 23:21:41 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-14 23:21:41 +0300 |
| commit | 840585ffc6f879b3e48e508a36da10471025e142 (patch) | |
| tree | b36fefca97f96b42da326c50ef2ea33a7ed17071 /tests | |
| parent | b7d5c1102c3679b67532f30f2613e4d2d61c59ba (diff) | |
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: <yes|no>" 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 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/cli.sh | 36 |
1 files changed, 36 insertions, 0 deletions
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-<timestamp>.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-<timestamp>.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 @@ -5507,6 +5540,9 @@ main() { '--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 test::run_case \ |
