summaryrefslogtreecommitdiff
path: root/tests/cli.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-15 18:16:47 +0300
committerPaul Buetow <paul@buetow.org>2026-06-15 23:50:41 +0300
commitb684fa5113239e595ecd1ccbcbd267ebbed9e62d (patch)
tree64b0a196f8510a3e974bdae114dff52f4fe5eb9f /tests/cli.sh
parent9d7c6ec3de935ef846e9f9a0512129990a1ddec4 (diff)
Persist the EXIF cache in a volatile ./cache dir parallel to ./dist
The per-photo `identify -verbose` cache lived in $DIST_DIR/.shuriken-cache, which is inside the throwaway staging dir and the published dist: a fresh/cleared dist lost it (forcing a full, slow re-identify of every original) and it got deployed to web servers. Move it to a volatile ./cache/exif directory parallel to ./dist (dirname of DIST_DIR resolves to the working dir in both the staging and direct contexts). Now an unchanged photo skips identify on every regenerate, the cache survives a cleared dist, and it is never deployed. --force clears ./cache/exif once up front (clear_exif_cache) and the run repopulates it, so force still does exactly one identify per photo. Dropped .shuriken-cache from the staging-copy loop. Tests and the audit doc updated for the new cache location. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'tests/cli.sh')
-rwxr-xr-xtests/cli.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/cli.sh b/tests/cli.sh
index cabd96f..d2140e3 100755
--- a/tests/cli.sh
+++ b/tests/cli.sh
@@ -5444,13 +5444,16 @@ test_stats_bucket_boundaries_and_datetime_parsing() {
test_stats_collect_reads_cached_identify_output() {
local incoming_dir
local dist_dir
+ local cache_dir
test::setup
test::source_shuriken_lib
incoming_dir="$TEST_TMPDIR/incoming"
dist_dir="$TEST_TMPDIR/dist"
- mkdir -p "$incoming_dir" "$dist_dir/.shuriken-cache/exif"
+ # The EXIF cache lives in ./cache parallel to ./dist (dirname of DIST_DIR).
+ cache_dir="$TEST_TMPDIR/cache/exif"
+ mkdir -p "$incoming_dir" "$cache_dir"
printf 'fake\n' > "$incoming_dir/one.jpg"
printf 'fake\n' > "$incoming_dir/two.jpg"
@@ -5463,12 +5466,12 @@ test_stats_collect_reads_cached_identify_output() {
photo_cache_signature 'one.jpg' "$incoming_dir/one.jpg"
printf ' exif:Make: Nikon\n'
printf ' exif:Model: Nikon Z6\n'
- } > "$dist_dir/.shuriken-cache/exif/one.jpg.txt"
+ } > "$cache_dir/one.jpg.txt"
{
photo_cache_signature 'two.jpg' "$incoming_dir/two.jpg"
printf ' exif:Make: Nikon\n'
printf ' exif:Model: Nikon Z6\n'
- } > "$dist_dir/.shuriken-cache/exif/two.jpg.txt"
+ } > "$cache_dir/two.jpg.txt"
collect_photo_exif_stats